Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

client side validation trouble

1 view
Skip to first unread message

DaveyP

unread,
Apr 29, 2008, 6:27:27 AM4/29/08
to
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.

DaveyP

unread,
Apr 29, 2008, 10:16:34 AM4/29/08
to
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?

bruce barker

unread,
Apr 29, 2008, 12:12:01 PM4/29/08
to
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)

0 new messages