Posted By

krisdb on 04/13/07


Tagged

ASP


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

remix4
nelda751
ckayra
asifrizvigmailcom
britevents


month, day, year drop-downs


 / Published in: ASP
 

  1. dim sMo: sMo = request.form("month")
  2. dim sDay: sDay = request.form("day")
  3. dim sYear: sYear = request.form("year")
  4.  
  5. dim dtDate: dtDate = sMo & "/" & sDay & "/" & sYear
  6.  
  7. if (isDate(dtDate)) then _
  8. dtDate = cdate(dtDate)
  9.  
  10. Response.write("<select name=""month"" id=""required"">")
  11. Response.write("<option value=""""></option>")
  12.  
  13. dim i
  14. for i = 1 to 12
  15. if cint(i) = i then
  16. response.write "<option value="""&i&""" selected>" &i&" - "&monthname(i,1) & "</option>"
  17. else
  18. response.write "<option value="""&i&""">" &i&" - "&monthname(i,1) & "</option>"
  19. end if
  20. next
  21.  
  22. Response.write("</select>")
  23. Response.write(" / ")
  24. response.write("<select name=""day"" style=""width:40px;"" id=""required"">")
  25. response.write ("<option value=""""></option>")
  26.  
  27. for i = 1 to 31
  28. if cint(i) = i then
  29. response.write "<option value="""&i&""" selected>"&i&"</option>"
  30. else
  31. response.write "<option value="""&i&""">"&i&"</option>"
  32. end if
  33. next
  34.  
  35. response.write ("</select>")
  36. response.write (" / ")
  37. response.write ("<select name=""year"" style=""width:60px;"" id=""required"">")
  38. response.write ("<option value=""""></option>")
  39.  
  40. for i = year(now) to year(now)-50 step -1
  41. if cint(i) = i then
  42. response.write "<option value="""&i&""" selected>"&i&"</option>"
  43. else
  44. response.write "<option value="""&i&""">"&i&"</option>"
  45. end if
  46. next
  47.  
  48. response.write ("</select>")

Report this snippet  

You need to login to post a comment.