ValidatorOnSubmit and Ajax calls

R

rm1234

All,

I am using XmlHttp / PageMethods to refresh a portion of web page that
contains some asp.net validators that are enabled for client side
validation. But before I submit Ajax post request I want to be able to
use the client-side validation provided by asp.net controls. I tried
calling ValidatorOnSubmit() function before doing xml http postback
from javascript but it always returns true even though some required
fields are empty. on the same form if I keep a submit button all
validations work properly.
Is it possible to trigger ValidatorOnSubmit() from javascript so that
it validates all client side validations ?

Thanks in adv for help,
ram.
 
C

Chris Fulstow

Hi Ram

Try calling Page_ClientValidate() and checking its return value. This
should trigger the client-side validation.

Chris
 
R

Ram

Hi Ram

Try calling Page_ClientValidate() and checking its return value. This
should trigger the client-side validation.

Chris





- Show quoted text -

Thanks Chris!!
 

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,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top