Thursday , 23 March 2017
Home » jQuery » [PHP] TinyMCE Validation using jQuery
[PHP] TinyMCE Validation using jQuery

[PHP] TinyMCE Validation using jQuery

Hello Friends,

I was working with jQuery validation since long time. I never thought to validate TinyMCE using jQuery as description is most probably optional field. Yesterday I need to validate TinyMCE and I just out a required class in textarea as jQuery validation. Now Issue is that, jQuery calls validation on click on submit button and TinyMCE is transferring value of editor into textarea once submit button clicked. So for first click, jQuery shows error message and TinyMCE transfer the values in to textarea. After this, all works fine. This means one need to click on submit button two times to submit the particular page.

I found a way to transfer the values of editor to textarea so jQuery validate it correctly. jQuery and TinyMCE works together. Below is the code to work TinyMCE and jQuery validation together.

$(document).ready(function(){
	$('#btnsubmit').click(function() {
		var content = tinyMCE.activeEditor.getContent(); // get the content
		$('#email_body').val(content); // put it in the textarea
	});
	$("#frm").validate();
});

TinyMCE Validation using jQuery, TinyMCE and jQuery Validation together, TinyMCE and jQuery Validation not working, jQuery Validation TinyMCE not working, TinyMCE Click event will resolved using above code.

      
Plugin by: PHP Freelancer

About Rakshit Patel

I am PHP Freelancer, Rakshit Patel working as PHP Programmer India. I have developed this site to share my knowledge, thoughts and experience during the development of projects. We are group of developers working together. If you want to hire us for any PHP related work, you can reach me via Email, Phone or Chat.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Notify me of followup comments via e-mail. You can also subscribe without commenting.