Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all,


I've a registration form and added some validation controls like phone number,email and some required field validator.
Ex: Suppose if i write wrong email id automatically a email validation message is displaying and the same for phone number also and finally instead of clicking Submit if i click on Cancel button (remember i wrote some text in email and phone fields and validation messages are enabled). The form/Pop Up Modal is closed. Again when i open the modal pop up for filling the fields the previous messages enabled.

Kindly help me how to disable the validation messages after closing the modal pop up and when i open the form should nor show previous data and validation messages.

Thanks in advance!
Posted
Comments
member 8888995 18-Nov-13 1:54am    
Please paste your code
Rockstar_ 18-Nov-13 2:21am    
Contains some text boxes,some drop downs,required field validators,Regular expressions and Cancel and Submit Buttons.

You can use the java script to clear the Validation text as shown below.

var obj = document.getElementById("RequiredFieldValidator1");
obj.innerHTML = "";



Wrap up with any suitable function and call the same on your reset button click.


Hope it helps
 
Share this answer
 
v2
Comments
Rockstar_ 18-Nov-13 1:58am    
There are around 40 validation controls on the page, do i have to write all those control names to access?
The Doer 18-Nov-13 2:35am    
Yes you have to mention their ID's.
 
Share this answer
 
You can use CausesValidation="false" on cancel button aspx page..It will disable all the validation.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900