JScript / ASP.NET question

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
 
J

John Saunders

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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top