Click here to Skip to main content
Click here to Skip to main content

Tagged as

Enable or Disable ASP.NET Validation on Client Side

, 2 May 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
How to enable or disable ASP.NET validation on client side


Here is the solution to enable/disable ASP.NET validation using JavaScript.

Scenario: Suppose I have a dropdown which contains a list of Asian countries and Other when user is selecting Other than only txtOtherCity is enabled else disable, at that I disable the required field validation for Other city (rfvOtherCity).

ValidatorContronName:This is ClientID of the Validation control.
Boolean:true(Enable) or false(Disable)
ValidatorEnable(document.getElementById('<%=rfvOtherCity.ClientID%>'), false);

Please provide a "Vote" if this would be helpfulRose | [Rose] .



This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Sunasara Imdadhusen
Software Developer (Senior) Infostretch Ahmedabad-Gujarat
India India
Aspiring for a challenging carrier wherein I can learn, grow, expand and share my existing knowledge in meaningful and coherent way.

sunaSaRa Imdadhusen
  1. 2nd Best Mobile Article of January 2015
  2. 3rd Best Web Dev Article of May 2014
  3. 2nd Best Asp.Net article of MAY 2011
  4. 1st Best Asp.Net article of SEP 2010
Read More Articles...
Follow on   Twitter   Google+   LinkedIn

Comments and Discussions

GeneralMy vote of 5 PinmemberSavalia Manoj M7-Nov-12 2:10 
GeneralRe: My vote of 5 PinprofessionalSunasara Imdadhusen22-Apr-14 4:10 
QuestionDefinition of ValidatorEnable? Pinmembertahir.h4-Oct-12 3:35 
AnswerRe: Definition of ValidatorEnable? PinmemberSunasara Imdadhusen4-Oct-12 3:59 
GeneralThanks, this is not appreciation! PinmemberSunasara Imdadhusen22-Aug-11 17:57 
GeneralReason for my vote of 1 to short. I would have preferred an... PinmemberMohammad_Denmark22-Aug-11 4:15 
GeneralRe: Reason for my vote of 1to short. I would have preferred an... PinprofessionalSunasara Imdadhusen22-Apr-14 4:10 
GeneralThanks for finding bug. PinmemberSunasara Imdadhusen2-May-11 23:55 
GeneralHi Sunasara, Fix the typo in last line of the code Validator... Pinmvpthatraja5-Mar-11 2:24 
GeneralRe: Hi Sunasara,Fix the typo in last line of the codeValidator... PinprofessionalSunasara Imdadhusen22-Apr-14 4:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150327.1 | Last Updated 3 May 2011
Article Copyright 2010 by Sunasara Imdadhusen
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid