Loading ...

TinyMCE validation problem in ASP.Net | CodeAsp.Net

TinyMCE validation problem in ASP.Net

 /5
0 (0votes)

I have used a Tinymce editor on a page and placed a required field validator to validate textarea. When I click the button at first time, it was gives a validaion error message even field was not empty, but at second time it  submitted succesfully. Then I was tried some code which has solved my issue.

The following describes how to use a  validator  along side TinyMCE to validate the contents of the textarea. Add the validator and setup the properties as you normally setting the control to validate to the ID of the textarea. The key is to call TinyMCE's triggerSave() method on OnClientClick, so the editor can synch up to the underlying textarea. Once this is done the textarea now has content.

if you donot do this then validator treated the text area is blank while sychn up.

 

<asp:Button id="btn1" runat="server" OnClientClick="tinyMCE.triggerSave(false,true);"/>

 

Hope this will help..

Comments (2)

   
yuri
Dhanyavad^-))))
3/25/2009
 · 
by
   
Daniel
I'm not doing ASP.NET, but client-side Javascript validation, having the same problem.  Explicitly calling the TinyMCE triggerSave() method fixed my problem.  Thanks for sharing the solution!
5/5/2009
 · 
by

Top Posts