Over a million developers have joined DZone.

How To Enable Or Disable Asp.net Validation Control Using Javascript

Here is the solution to enable/disable asp.net validation using javascript
Suppose i have dropdown which contain list of Asian countries and Other when user are selecting Other than only txtOtherCity is enbled else disable at that i disable 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);

Spring Framework

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}