Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple vbs conditional question

Status
Not open for further replies.

joyceda59

Technical User
Apr 3, 2007
29
0
0
CA
hi im new to vbscript.

basically what im trying to achieve is if a user selects a certain date greater than the current date from this calendar in a form, then the time field ( next field) should be defaulted to empty. Initially when a user opens this form, the date field is defaulted to current date and the time field is defaulted to "ASAP". If the user changes the date to a greater date, then I immediately want the time field to get rid of "ASAP" and show an empty field. How can i achieve this?

here is my code:

distDate = Request("dateTextField")

If CDate(disDate) > Date Then

distTime = ""

Response.Write "<input type ='text' name ='time' id = 'distributionTime' value = '" &distTime& "' />"
end if


Im just confuse on, how i am supposed to immediately change the time field to blank as soon a the user selects a date greater than the current date. I need to to occur before th user lcicks the submit button. Plz help!
 
I think you would want to do this with client-side scripting...maybe use onchange for that field to check the date entered and if it is greater then clear the field.

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top