Home All Groups Group Topic Archive Search About

Disable Validator through Client-Site code

Author
6 Feb 2006 12:45 AM
Axel Dahmen
Hi,

I'm using a RangeValidator on a text input field to make sure that a date
entered in there is in the future.

On my form there is also a DropDownList control. I now want to disable the
text box's RangeValidator when the user selects a particular item from the
drop-down list.

Using AutoPostBack on the DropDownList control and using server-side code
this would be an easy task. But I want to provide the user with improved
website experience and thus I want to disable the RangeValidator depending
on the drop-down list selection using client-side JavaScript code.

Is this possible? And how can I do this? I'm using .NET 1.0 and 1.1.

TIA,
Axel Dahmen

Author
6 Feb 2006 9:33 AM
Steven Cheng[MSFT]
Hi Axel,

Welcome to the ASP.NET newsgroup.

As for the validation control cilentside manipulation question, based on my
experience, for ASP.NET 1.X, there is some clentside script based API for
manipulating ASP.NET validation controls at clientside. It contains the
method for make a certain validation control do validation , or
enable/disable a certain validator, or query the current validation status
of a validator....   Here is a good msdn article which described the
detailed ASP.NET page validation model(serverside and clientside), and the
clientside valication API are also introduced:

#ASP.NET Validation in Depth
http://msdn.microsoft.com/library/en-us/dnaspp/html/aspplusvalid.asp?frame=t
rue#aspplusvalid_clientside

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Author
4 Mar 2006 4:03 AM
Axel Dahmen
That's it!!! Great article!

Thanks!
www.sportbootcharter.com
Axel Dahmen



----------
Show quoteHide quote
"Steven Cheng[MSFT]" <stch***@online.microsoft.com> schrieb im Newsbeitrag
news:#R5VnBwKGHA.3680@TK2MSFTNGXA02.phx.gbl...
> Hi Axel,
>
> Welcome to the ASP.NET newsgroup.
>
> As for the validation control cilentside manipulation question, based on
my
> experience, for ASP.NET 1.X, there is some clentside script based API for
> manipulating ASP.NET validation controls at clientside. It contains the
> method for make a certain validation control do validation , or
> enable/disable a certain validator, or query the current validation status
> of a validator....   Here is a good msdn article which described the
> detailed ASP.NET page validation model(serverside and clientside), and the
> clientside valication API are also introduced:
>
> #ASP.NET Validation in Depth
>
http://msdn.microsoft.com/library/en-us/dnaspp/html/aspplusvalid.asp?frame=t
Show quoteHide quote
> rue#aspplusvalid_clientside
>
> Hope this helps.
>
> Regards,
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
>
>
Author
6 Mar 2006 1:52 AM
Steven Cheng[MSFT]
Thanks for your followup Axel,

Glat that it is of assistance.

Good luck!~

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)