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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TextBox - OnChange Event to validate input

Status
Not open for further replies.

sgibbs

Programmer
Jun 29, 2000
3
US
I have a form which requires a date to be input. Here is the control:

<input type=&quot;text&quot; name=&quot;StopDate&quot; size=&quot;10&quot; maxlength=&quot;10&quot; onchange=&quot;ValidDate;&quot;>

here is the sub which is supposed to be called:

<% sub ValidDate()

if isdate(request.form(&quot;StopDate&quot;)) = false then
ErrorText = &quot;Invalid Date Entered&quot;
msgbox errorText
else
msgbox &quot;Success&quot;
end if

end sub
%>

Nothing is happening when I enter data in the control (either success or failure). I can't find the syntax to use the onchange event. Also tried the onblur event with no success. Any suggestions?

Thanks much in advance!
 
make sure that if you want to use client side validation you make the sub a client side script, remove the <%%> and put it in <Script language=&quot;javascript&quot;> jared@aauser.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top