I have many ascx control files in which I am using the tinymce editor and I am calling all ascx file in one master page on different different btn click.
Now I want, when I click on button A, and I have typed something into the tinymce editor and suddenly I click on button B then the page which is opened on btn click A must ask whether you need to save this text or not on btn click B.
How can I do it with the help of jquery? If there is some other way then please le开发者_JS百科t me know.
I would like you to refer to my answer here....
Using the jQuery Validate plugin with the TinyMCE editor
It will solve your issue of validating the editor client side before sending it to server.
When the user starts editing the content in tinymce editor set a flag isContentChanged
to true
. Add an event handler to the Button B. In the event handler, you can check for the isContentChanged
flag and show an alert that the user is losing unsaved information, if the flag is true. You can use basic JS or Jquery to do this.
精彩评论