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

Forum statistics

Threads
473,982
Messages
2,570,189
Members
46,735
Latest member
HikmatRamazanov

Latest Threads

Top