views:

62

answers:

1

I m using a dialog on which jquery validation is performed like required,email etc.

On click of a button my dialog appears as a popup and error messages are shown, but when i close my dialog and open it once again the previous error messages are shown until i interact with my controls.

So i want, is to refresh the dialog or reset the validation messages so whenever i open my dialog it comes as without the previous error messages.

Thanks in advance.

A: 

I imagine your error message are in a particular div.

You just need to set the html content of that div to nothing and then you can display your dialog.

If you post some code, I could be more precise.

Loïc Février
here is a sample of code,
<div id="divAddUpdateAct" runat="server" clientidmode="Static" style="padding-left: 0"> <fieldset class="popupFieldset"> <table> <tr> <td> Remarks : </td> <td colspan="3"> <textarea id="txtRemarks" runat="server" clientidmode="Static" rows="4" cols="10" class="textArea"></textarea> </td> </tr> </table> </fieldset> </div>
i m writing followin code on document.ready() or validate the content of textbox. $('#formMaster').validate({ onsubmit: false }); $('#txtRemarks').rules("add", { required: true, messages: { required: "Please enter remarks." } });
So when i click on button which validates the textarea,it gives me error.But when i click on some link which fills text in that textarea and open the dialog again the errror message remains still there.So text is there in that textarea upon loading but still error message is there untill i click on button or textarea cotrol.
Please edit your question to add you code and add a more complete code : your are talking about `$('#formMaster')` but not `id=formMaster` in your code. Edit the question and then delete the comments.
Loïc Février