473,387 Members | 1,550 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 3519
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

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

Similar topics

11
by: David Messner | last post by:
Ok I know this is simple but the statement eludes me... I have a date field where I want the default value on the data entry form's date field to be the last date entered. I figure I can do this...
9
by: deko | last post by:
What is it with these dates? What are they so much trouble? All I want to do is subtract an hour, but not if that makes dtmTest less than dtmClt. Dim dtmStart As Date Dim dtmEnd As Date Dim...
2
by: Martin Raychev | last post by:
Hi all, I have the following problem: I have a private method that returns a SqlDataReader. For this to work I have not to close the DB connection in the above method. I do this only to
5
by: Nathan Sokalski | last post by:
I have a user control that contains three variables which are accessed through public properties. They are declared immediately below the "Web Form Designer Generated Code" section. Every time an...
0
by: salo | last post by:
Hi ........Im working with c# and asp.net and i have two calendar control in my form and i want the cliked date value to be get displayed in the textbox. i gave the code as ...
1
by: simbarashe | last post by:
Hie could someone please help me with getting and using the current page url. I have a function that gets the url, I want to use it with header(location : XXX) but it wont work. The code is as...
8
by: chimambo | last post by:
Hi Everyone, I have a huge problem. I am trying to get two corresponding variables from a Checkbox and a Text box. e.g. If I check a value, say: enrolled? (checkbox) then I have to put the date...
9
Catalyst159
by: Catalyst159 | last post by:
I have a form which is used to calculate residential Floor Area Ratio (FAR). The form is structured into seven parts as follows: Part A: Maximum FAR and Floor Area: Part B: Gross Floor Area of...
7
vikas251074
by: vikas251074 | last post by:
I am getting error above in following code since few days giving tension day and night. How can I solve this? I am facing since Oct.25. in line no. 362 After doing a lot of homework, I am...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.