Not getting date value  | Familiar Sight | | Join Date: Dec 2007 Location: Patna
Posts: 198
| |
I am not getting date value in spite of my good effort. This code was working in my last office where I work. Now I am trying to work at my home pc. but not getting date value. Any can help me why this happens. This is my part of code given below. -
<%@ Language=VBScript%>
-
<%Option Explicit%>
-
<html>
-
<head>
-
<title>SABF</title>
-
<!--#include file="font.css"-->
-
<!--#include file="func.inc"-->
-
</head>
-
<body>
-
<!--#include file="head.inc"-->
-
<%
-
Dim R
-
Dim R1
-
Dim vempno, vempname, vdesign, vgrade, vOffstaff, vdob, vdoj, vdos, vndos, vdoa, vdojgr, vreason, voption, vcommutation
-
Dim vrehabilitation, vBasic2003, vstag2003, vpersonalpay2003, vsplpay2003, vadhoc2003, vnpa2003, vda2003, vprotectedpay2003
-
Dim vbasic, vstag, vpersonalpay, vsplpay, vadhoc, vnpa, vda, vprotectedpay,vbeneficiaryspouse, vdobos, valtnominee1,
-
Dim valtnominee2, valtnominee3, valtnominee4, valtnominee5, valtnominee6, vaddress, vcontact, vassesseno, vtotal, v1third
-
Dim vrefund, vmonthlypension, vchoiceopt
-
Dim errorMsg
-
Dim conn
-
Dim i
-
Dim vdobyyyy, vdobmm, vdobdd
-
Dim vdojyyyy, vdojmm, vdojdd
-
Dim vdosyyyy, vdosmm, vdosdd
-
Dim vndosyyyy, vndosmm, vndosdd
-
Dim vdoayyyy, vdoamm, vdoadd
-
Dim vdojgryyyy, vdojgrmm, vdojgrdd
-
Dim vdobosyyyy, vdobosmm, vdobosdd
-
Dim no_of_day
-
If Not IsEmpty(Request.Form("submit")) then
-
vempno = Request.Form("vempno")
-
vempname = Request.Form("vempname")
-
vdesign = Request.Form("vdesign")
-
vgrade = Request.Form("vgrade")
-
vdobyyyy = Request.Form("vdobyyyy")
-
vdobmm = Request.Form("vdobmm")
-
vdobdd = Request.Form("vdobdd")
-
vdojyyyy = Request.Form("vdojyyyy")
-
vdojmm = Request.Form("vdojmm")
-
vdojdd = Request.Form("vdojdd")
-
vaddress = trim(vaddress)
-
vassesseno = trim(vassesseno)
-
vcontact = trim(vcontact)
-
vchoiceopt = trim(vchoiceopt)
-
%>
-
<div style="Position:Absolute; top:120; left:50; background-color: #f0f0f0">
-
<h2>SABF Entry</h3>
-
<hr>
-
<p>
-
<form method="POST" action="sabf.asp">
-
<%
-
If len(errorMsg) > 0 Then
-
Response.Write "<p><font color='red'>" & errorMsg & "</font></p>"
-
End If
-
%>
-
<table width=900>
-
<tr>
-
<table align="center">
-
<tr>
-
<td align="center"><font face="arial"><h3>SABF Entry</h3></font></h3>
-
</tr>
-
<tr>
-
<td align="center"><font face="arial" size=4>Creation</font></h3>
-
</tr>
-
</table>
-
</tr>
-
<tr>
-
<table align="center">
-
<tr>
-
<td align="right"><font face="arial" size=2>Employee No : </font></td>
-
<td align='left'><input type="text" style="width:100px" name="vempno"></td>
-
<td align="right"><font face="arial" size=2>Employee Name : </font></td>
-
<td align='left'><input type="text" style="width:300px" name="vempname"></td>
-
</tr>
-
<tr>
-
<td align="right"><font face="arial" size=2>Designation : </font></td>
-
<td align='left'><input type="text" style="width:300px" name="vdesig"></td>
-
<td align="right"><font face="arial" size=2>Grade : </font></td>
-
<td align='left'><input type="text" style="width:300px" name="vgrade"></td>
-
</tr>
-
<tr>
-
<td align="right"><font face="arial" size=2>Category : </font></td>
-
<td align="left">
-
<font face="arial" size=2><select name="voffstaff">
-
<option value="Officer">Officer</option>
-
<option value"staff" selected>Staff</option></select>
-
</font>
-
</td>
-
<td align="right"><font face="arial" size=2>Date of Birth : </font></td>
-
<td>
-
<select name="vdobyyyy">
-
<%i=1965
-
do while i <= year(date)
-
If i = Cint(vdobyyyy) Then%>
-
<option value="<%=vdobyyyy%>" selected><%=vdobyyyy%></option>
-
<%Else
-
If i = 2007 then
-
If IsEmpty(vdobyyyy) Then%>
-
<option value="<%=i%>" selected><%=i%></option>
-
<%End If
-
else%>
-
<option value="<%=i%>"><%=i%></option>
-
<%end If
-
End If
-
i = i + 1
-
loop%>
-
</select>
-
<select name="vdobmm">
-
<%i=1
-
Do while i <= 12
-
If i = Cint(vdobmm) then%>
-
<option value="<%=vdobmm%>" selected><%=vdobmm%></option>
-
<%Else%>
-
<option value="<%=i%>"><%=i%></option>
-
<%End If
-
i = i + 1
-
loop%>
-
</select>
-
<select name="vdobdd">
-
<%If vdobyyyy mod 4 = 0 And vdobmm = 2 Then
-
no_of_day = 29
-
ElseIf vdobyyyy mod 4 <> 0 and vdobmm = 2 Then
-
no_of_day = 28
-
ElseIf vdobmm=4 or vdobmm=6 or vdobmm=9 or vdobmm=11 Then
-
no_of_day = 30
-
Else
-
no_of_day = 31
-
End If
-
i=1
-
Do while i <= no_of_day
-
If i = Cint(vdobdd) Then%>
-
<option value="<%=vdobdd%>" selected><%=vdobdd%></option>
-
<%Else%>
-
<option value="<%=i%>"><%=i%></option>
-
<%End If
-
i = i + 1
-
loop%>
-
</select><font color='blue' size=2>(yyyy-mm-dd)</font>
-
</td>
-
</tr>
-
</table>
-
</tr>
-
<tr>
-
<table align="center">
-
<tr>
-
<td align="center"><input type="Submit" name="submit" value="Save">
-
<input type="reset" name="reset" value="Reset">
-
</td>
-
</tr>
-
</table>
-
</tr>
-
</table>
-
</form>
-
</p>
-
</div>
-
<%
-
End If
-
%>
-
<!--#include file="menu.inc"-->
-
</body>
-
</html>
-
|  | Familiar Sight | | Join Date: Dec 2007 Location: Patna
Posts: 198
| | | re: Not getting date value
problem may lies in line no. 91 - 138. Please suggest me where should be mistake
|  | Moderator | | Join Date: Jan 2007 Location: logan, utah
Posts: 2,690
| | | re: Not getting date value
I don't understand, what is not working? everything in the code looks like it should work, if you said what result you got it might help to clarify the problem.
Jared
|  | Familiar Sight | | Join Date: Dec 2007 Location: Patna
Posts: 198
| | | re: Not getting date value
list of year, list of months and list of days is not displaying .
The date field is completely blank.
|  | Moderator | | Join Date: Jan 2007 Location: logan, utah
Posts: 2,690
| | | re: Not getting date value
OK then, navigate to the page and post the code you get from "view source"
Jared
|  | Familiar Sight | | Join Date: Dec 2007 Location: Patna
Posts: 198
| | | re: Not getting date value
code is already given in the first part. You can see in this thread
|  | Familiar Sight | | Join Date: Dec 2007 Location: Patna
Posts: 198
| | | re: Not getting date value
The problem is that list of year, list of months and list of days is not displaying in date field.
|  | Moderator | | Join Date: Jan 2007 Location: logan, utah
Posts: 2,690
| | | re: Not getting date value Quote:
Originally Posted by vikas251074 code is already given in the first part. You can see in this thread No, I am not talking about the ASP code. I am talking about the HTML code that you see AFTER the server parses the script. AFTER you navigate to the page FROM YOUR BROWSER you can see the source code (in Firefox go view -> Page Source). This will show a listing of the code that the server sent to the browser. This is the code I asked you to post. The code you posted in the first post is the raw ASP code, the code the server interprets. This should not be the code that is sent to the browser. Does this make sense?
Jared
| | Newbie | | Join Date: Oct 2009 Location: Grant, AL
Posts: 17
| | | re: Not getting date value
I realize it's been a while since the last post on this, but I think I found the problem. There is a conditional section between lines 30 and 157 that only executes when the page has been called after a form on a previous page has been submitted. If you just open this page, then the form submittal has not been made and everything between lines 30 and 157 will not be displayed.
|  | Familiar Sight | | Join Date: Dec 2007 Location: Patna
Posts: 198
| | | re: Not getting date value
I am glad to inform you that this problem has been rectified.
All this problem was due to IIS configuration setting that does not allow to run ASP.
Now it has been rectified. Previously not a single asp programme was running. And I was got confused at the time. Now this has been rectified.
Thanx for ansering sir,
Regards,
Vikas
|  | Similar ASP / Active Server Pages bytes | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,510 network members.
|