Connecting Tech Pros Worldwide Forums | Help | Site Map

ValidatorOnSubmit and Ajax calls

rm1234@gmail.com
Guest
 
Posts: n/a
#1: Sep 26 '07
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.


Chris Fulstow
Guest
 
Posts: n/a
#2: Sep 26 '07

re: ValidatorOnSubmit and Ajax calls


Hi Ram

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

Chris

On Sep 26, 9:01 am, rm1...@gmail.com wrote:
Quote:
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.

Ram
Guest
 
Posts: n/a
#3: Sep 26 '07

re: ValidatorOnSubmit and Ajax calls


On Sep 25, 8:54 pm, Chris Fulstow <chrisfuls...@hotmail.comwrote:
Quote:
Hi Ram
>
Try calling Page_ClientValidate() and checking its return value. This
should trigger the client-side validation.
>
Chris
>
On Sep 26, 9:01 am, rm1...@gmail.com wrote:
>
>
>
Quote:
All,
>
Quote:
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 ?
>
Quote:
Thanks in adv for help,
ram.- Hide quoted text -
>
- Show quoted text -
Thanks Chris!!

Closed Thread