JScript / ASP.NET question

  • Thread starter Thread starter Chuck Traywick
  • Start date Start date
C

Chuck Traywick

Finally getting some thing to work but am perlpexed by
client side jScript code.

Two questions we'd really appreciate some feedback on:

1: If we have a function in JScript that validates a
user input, and the function detects bad data how to I
force the user back to the same field? If the data is
wrong we want to force the focus back to the same text
box. The current function is on the ONCHANGE event.

2: On an HTML textbox we have a pointer to the function
mentioned above. If you wanted to have a generic ZIP
CODE box, for example, how do you pass in some parameters
like the name of the textbox ojbect at runtime? In other
words would like to have a standard function to validate
zip codes , phone numbers etc and call this one function
for each type of data with the name of the calling
textbox and some text for error messgaes.

Thanks

Chuck
 
Chuck Traywick said:
Finally getting some thing to work but am perlpexed by
client side jScript code.

Two questions we'd really appreciate some feedback on:

1: If we have a function in JScript that validates a
user input, and the function detects bad data how to I
force the user back to the same field? If the data is
wrong we want to force the focus back to the same text
box. The current function is on the ONCHANGE event.

You may find the following helpful:

ASP.NET Validation in Depth
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/htm
l/aspplusvalid.asp).
 
Back
Top