Date Form Fields

Results 1 to 2 of 2

Thread: Date Form Fields

  1. #1
    BL Guest

    Default Date Form Fields

    Is there anyway to have a date form field automaticaly put the "/" in between the day month and year if a person just puts the numbers in? For example if i were to just enter 2272000 can it be automatically converted to 2/27/2000 using ASP or jscript?<BR>same

  2. #2
    Join Date
    Dec 1969

    Default RE: Date Form Fields

    Of course there is, BL. You just have to moderate your date a little bit. You put "2272000" in your post, and you can&#039t do it that way. Let&#039s say the date was "2122000". Then you wouldn&#039t know if it was 2/12/2000 or 21/2/2000. So it has to be "02122000" or "21022000", but let&#039s say you have that figured out:<BR><BR>Our test date is 02122000.<BR><BR>&#060;%<BR> MyDate = "02122000"<BR> MyDate = Left(MyDate,2) & "/" & Mid(MyDate,3,2) & "/" & Right(MyDate,4)<BR>Response.Write MyDate<BR>%&#062;<BR><BR>I hope that&#039s what you&#039re looking for. If not, let me know and I&#039ll take another look at it.<BR><BR>Take care,<BR>Lasse.<BR>( )<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts