469,645 Members | 1,941 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

Not getting date value

vikas251074
198 100+
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.


Expand|Select|Wrap|Line Numbers
  1. <%@ Language=VBScript%>
  2. <%Option Explicit%>
  3. <html>
  4. <head>
  5. <title>SABF</title>
  6. <!--#include file="font.css"-->
  7. <!--#include file="func.inc"-->
  8. </head>
  9. <body>
  10. <!--#include file="head.inc"-->
  11. <%
  12. Dim R
  13. Dim R1 
  14. Dim vempno, vempname, vdesign, vgrade, vOffstaff, vdob, vdoj, vdos, vndos, vdoa, vdojgr, vreason, voption, vcommutation
  15. Dim vrehabilitation, vBasic2003, vstag2003, vpersonalpay2003, vsplpay2003, vadhoc2003, vnpa2003, vda2003, vprotectedpay2003
  16. Dim vbasic, vstag, vpersonalpay, vsplpay, vadhoc, vnpa, vda, vprotectedpay,vbeneficiaryspouse, vdobos, valtnominee1,
  17. Dim valtnominee2, valtnominee3, valtnominee4, valtnominee5, valtnominee6, vaddress, vcontact, vassesseno, vtotal, v1third
  18. Dim vrefund, vmonthlypension, vchoiceopt
  19. Dim errorMsg
  20. Dim conn
  21. Dim i
  22. Dim vdobyyyy, vdobmm, vdobdd
  23. Dim vdojyyyy, vdojmm, vdojdd
  24. Dim vdosyyyy, vdosmm, vdosdd
  25. Dim vndosyyyy, vndosmm, vndosdd
  26. Dim vdoayyyy, vdoamm, vdoadd
  27. Dim vdojgryyyy, vdojgrmm, vdojgrdd
  28. Dim vdobosyyyy, vdobosmm, vdobosdd
  29. Dim no_of_day
  30.   If Not IsEmpty(Request.Form("submit")) then
  31.     vempno = Request.Form("vempno")
  32.     vempname = Request.Form("vempname")
  33.     vdesign = Request.Form("vdesign")
  34.     vgrade = Request.Form("vgrade")
  35.     vdobyyyy = Request.Form("vdobyyyy")
  36.     vdobmm = Request.Form("vdobmm")
  37.     vdobdd = Request.Form("vdobdd")
  38.     vdojyyyy = Request.Form("vdojyyyy")
  39.     vdojmm = Request.Form("vdojmm")
  40.     vdojdd = Request.Form("vdojdd")
  41.     vaddress = trim(vaddress)
  42.     vassesseno = trim(vassesseno)
  43.     vcontact = trim(vcontact)
  44.     vchoiceopt = trim(vchoiceopt)
  45. %>
  46.   <div style="Position:Absolute; top:120; left:50; background-color: #f0f0f0">
  47.     <h2>SABF Entry</h3>
  48.     <hr>
  49.     <p>
  50.     <form method="POST" action="sabf.asp">
  51. <%
  52.       If len(errorMsg) > 0 Then
  53.         Response.Write "<p><font color='red'>" & errorMsg & "</font></p>"
  54.       End If
  55. %>
  56.       <table width=900>
  57.         <tr>
  58.           <table align="center">
  59.             <tr>
  60.               <td align="center"><font face="arial"><h3>SABF Entry</h3></font></h3>
  61.             </tr>
  62.             <tr>
  63.               <td align="center"><font face="arial" size=4>Creation</font></h3>
  64.             </tr>
  65.           </table>
  66.         </tr>
  67.         <tr>
  68.           <table align="center">
  69.             <tr>
  70.               <td align="right"><font face="arial" size=2>Employee No : </font></td>
  71.               <td align='left'><input type="text" style="width:100px" name="vempno"></td>
  72.               <td align="right"><font face="arial" size=2>Employee Name : </font></td>
  73.               <td align='left'><input type="text" style="width:300px" name="vempname"></td>
  74.             </tr>
  75.             <tr>
  76.               <td align="right"><font face="arial" size=2>Designation : </font></td>
  77.               <td align='left'><input type="text" style="width:300px" name="vdesig"></td>
  78.               <td align="right"><font face="arial" size=2>Grade : </font></td>
  79.               <td align='left'><input type="text" style="width:300px" name="vgrade"></td>
  80.             </tr>
  81.             <tr>
  82.               <td align="right"><font face="arial" size=2>Category : </font></td>
  83.               <td align="left">
  84.                  <font face="arial" size=2><select name="voffstaff">
  85.                        <option value="Officer">Officer</option>
  86.                        <option value"staff" selected>Staff</option></select>
  87.                  </font>
  88.               </td>
  89.               <td align="right"><font face="arial" size=2>Date of Birth : </font></td>
  90.               <td>
  91.                 <select name="vdobyyyy">
  92.                   <%i=1965
  93.                   do while i <= year(date)
  94.                     If i = Cint(vdobyyyy) Then%>
  95.                       <option value="<%=vdobyyyy%>" selected><%=vdobyyyy%></option>
  96.                     <%Else
  97.                       If i = 2007 then
  98.                         If IsEmpty(vdobyyyy) Then%>
  99.                           <option value="<%=i%>" selected><%=i%></option>
  100.                         <%End If
  101.                       else%>
  102.                         <option value="<%=i%>"><%=i%></option>
  103.                       <%end If
  104.                     End If
  105.                     i = i + 1
  106.                   loop%>
  107.                 </select>
  108.                 <select name="vdobmm">
  109.                   <%i=1
  110.                   Do while i <= 12
  111.                     If i = Cint(vdobmm) then%>
  112.                       <option value="<%=vdobmm%>" selected><%=vdobmm%></option>
  113.                     <%Else%>
  114.                       <option value="<%=i%>"><%=i%></option>
  115.                     <%End If
  116.                     i = i + 1
  117.                   loop%>
  118.                 </select>
  119.                 <select name="vdobdd">
  120.                   <%If vdobyyyy mod 4 = 0 And vdobmm = 2 Then
  121.                     no_of_day = 29
  122.                   ElseIf vdobyyyy mod 4 <> 0 and vdobmm = 2 Then
  123.                     no_of_day = 28
  124.                   ElseIf vdobmm=4 or vdobmm=6 or vdobmm=9 or vdobmm=11 Then
  125.                     no_of_day = 30
  126.                   Else
  127.                     no_of_day = 31
  128.                   End If
  129.                   i=1
  130.                   Do while i <= no_of_day
  131.                     If i = Cint(vdobdd) Then%>
  132.                       <option value="<%=vdobdd%>" selected><%=vdobdd%></option>
  133.                     <%Else%>
  134.                       <option value="<%=i%>"><%=i%></option>
  135.                     <%End If
  136.                     i = i + 1
  137.                   loop%>
  138.                 </select><font color='blue' size=2>(yyyy-mm-dd)</font>
  139.               </td>
  140.             </tr>
  141.           </table>
  142.         </tr>
  143.         <tr>
  144.           <table align="center">
  145.             <tr>
  146.               <td align="center"><input type="Submit" name="submit" value="Save">
  147.                                  <input type="reset" name="reset" value="Reset">
  148.               </td>
  149.             </tr>
  150.           </table>
  151.         </tr>
  152.       </table>
  153.     </form>
  154.     </p>
  155.   </div>
  156. <%
  157. End If
  158. %>
  159. <!--#include file="menu.inc"-->
  160. </body>
  161. </html>
  162.  
Sep 5 '09 #1
9 3200
vikas251074
198 100+
problem may lies in line no. 91 - 138. Please suggest me where should be mistake
Sep 7 '09 #2
jhardman
3,406 Expert 2GB
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
Sep 8 '09 #3
vikas251074
198 100+
list of year, list of months and list of days is not displaying .

The date field is completely blank.
Sep 15 '09 #4
jhardman
3,406 Expert 2GB
OK then, navigate to the page and post the code you get from "view source"

Jared
Sep 16 '09 #5
vikas251074
198 100+
code is already given in the first part. You can see in this thread
Sep 19 '09 #6
vikas251074
198 100+
The problem is that list of year, list of months and list of days is not displaying in date field.
Sep 19 '09 #7
jhardman
3,406 Expert 2GB
@vikas251074
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
Sep 29 '09 #8
gcube
17
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.
Oct 20 '09 #9
vikas251074
198 100+
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
Oct 21 '09 #10

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

9 posts views Thread by deko | last post: by
5 posts views Thread by Nathan Sokalski | last post: by
8 posts views Thread by chimambo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.