Your Ad Here

Posted By

fuzzylogic on 03/08/07


Tagged


Versions (?)

DatesForm


 / Published in: ASP
 

  1. function DatesForm(name, setdate)
  2.  
  3. MyDay = day(setdate)
  4. MyMonth = month(setdate)
  5. MyYear = year(setdate)
  6. response.write("<select name=""" & name & "month"">" & vbCrlf)
  7. m = 1
  8. m = m - 0
  9. while m <= 12
  10. response.write("<option value='" & m & "'")
  11. if m = MyMonth then
  12. response.write(" selected ")
  13. end if
  14. response.write(">" & m & "</option>" & vbCrlf)
  15. m = m + 1
  16. wend
  17. response.write("</select>/")
  18.  
  19. response.write("<select name=""" & name & "day"">")
  20. d = 1
  21. d = d - 0
  22. while d <= 31
  23. response.write("<option value='" & d & "'")
  24. if d = MyDay then
  25. response.write(" selected ")
  26. end if
  27. response.write(">" & d & "</option>" & vbCrlf)
  28. d = d + 1
  29. wend
  30.  
  31. response.write("</select>/")
  32.  
  33. response.write("<select name=""" & name & "year"">")
  34.  
  35. y = year(now()) -2
  36. while y <= year(now()) +2
  37. response.write("<option value='" & y & "'")
  38. if y = MyYear then
  39. response.write(" selected ")
  40. end if
  41. response.write(">" & y & "</option>" & vbCrlf)
  42. y = y + 1
  43. wend
  44.  
  45. response.write("</select>" & vbCrlf)
  46.  
  47. end function

Report this snippet  

You need to login to post a comment.