Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to execute client-side code _after_ client-side validation?

Reply
Thread Tools

How to execute client-side code _after_ client-side validation?

 
 
Bogdan
Guest
Posts: n/a
 
      06-08-2008
Hi,

I'd like to display (i.e. make visible) a label after a submit button is
clicked but only if the client-side validation is successful. If I did not
care about the validation then I'd simply modify style.display of the label
in my onclick (OnClientClick) script. The problem is that my script will
execute before the validation script.
Is there a way to execute my custom script after the validation takes place?

Thanks,
Bogdan



 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      06-08-2008
use ClientSCriptManager.RegisterOnSubmitStatement

-- bruce (sqlwork.com)

Bogdan wrote:
> Hi,
>
> I'd like to display (i.e. make visible) a label after a submit button is
> clicked but only if the client-side validation is successful. If I did not
> care about the validation then I'd simply modify style.display of the label
> in my onclick (OnClientClick) script. The problem is that my script will
> execute before the validation script.
> Is there a way to execute my custom script after the validation takes place?
>
> Thanks,
> Bogdan
>
>
>

 
Reply With Quote
 
 
 
 
Bogdan
Guest
Posts: n/a
 
      06-09-2008
Bruce,

Thanks for the reply. Your suggestion only partially worked for me. I have
a RequiredFieldValidator and RegularExpressionValidator attached to fields.
If the former fails than my onsumbit script is not executed. Unfortunately,
this is not the case for the regex validator - my onsubmit is executed
regardless if the validator fails or not. I tested it in IE, FireFox, and
Safari and got similar results.

Is OnSubmitStatement supposed to execute AFTER validators and only if the
validators are successful? I can't find any reference to it in the on-line
docs. I'd appreciate any links.

Thanks again,
Bogdan


"bruce barker" <> wrote in message
news:%...
> use ClientSCriptManager.RegisterOnSubmitStatement
>
> -- bruce (sqlwork.com)
>
> Bogdan wrote:
>> Hi,
>>
>> I'd like to display (i.e. make visible) a label after a submit button is
>> clicked but only if the client-side validation is successful. If I did
>> not care about the validation then I'd simply modify style.display of the
>> label in my onclick (OnClientClick) script. The problem is that my
>> script will execute before the validation script.
>> Is there a way to execute my custom script after the validation takes
>> place?
>>
>> Thanks,
>> Bogdan
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How to re-select row in a gridview _after_ sorting? Bogdan ASP .Net 1 12-08-2009 07:22 PM
How to Execute Code Behind Code in Inline aspx Kamal Ahmed ASP .Net 1 10-25-2005 08:09 AM
Can i execute aspx file in my asp pag with server.execute method(sorry) Savas Ates ASP General 1 08-17-2004 04:52 PM
Re: How do you execute VB code that resides in a Text File... CES ASP .Net 1 10-02-2003 01:26 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57