client side validation trouble

D

DaveyP

Ok.

I have a page with a textbox which is used to enter numeric data. If
data is entered, the code goes to the database and gets the relevant
data. If it's left blank, the code assumes that new data is being
entered and allocates a number.

The problem is that the client side validation (custom validator with
Jscript to check for numeric input) on the text box is firing twice.

Any ideas?

Ta.
 
D

DaveyP

Ok, sort of figured it.

The textbox has autopostback = true, cos it needs to get the relevant
data (if not invalid). Unless I'm wring (which in reality is most
likely), it's running the code once for the "lost focus" and once for
the postback.

If I'm right, how do I stop one of them?
 
B

bruce barker

you can't, it by design. the validation is called on lost focus, and on a
validated submit. your validation shoudl support running mutilple times.

-- bruce (sqlwork.com)
 

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,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top