The Question

user
By Mario XP (170) on 13th December 2011

Question: TinyMCE form validation problems ?

When I use TinyMCE on my web forms and try to validate that the text area is not empty, it doesn’t work.

i.e. there is text in the box but it says it’s empty.

If I remove TinyMCE then my validation javascript/jquery recognises properly that the textarea is not empty hence won’t throw the error.

Any ideas on what’s happening here ?

3 Answers

  • - Voted Best Answer Best Answer
    User Points: 25
    Posted on 14th December 2011
    Thumb up
    1 
    Thumb down
    0

    You might want to try the following code snippet. This will copy across what’s in the TinyMCE texteditor to the original one.

    $('#submit').click(function() {
        		var content = tinyMCE.activeEditor.getContent(); // get the content
        		$('#question_details').val(content); // put it in the textarea
    		});
    
    • User Points: 170
      Posted on 14th December 2011
      Thumb up
      0 
      Thumb down
      0

      Sorry mate but I can’t see the code snippet ?

      • User Points: 170
        Posted on 2nd March 2012
        Thumb up
        0 
        Thumb down
        0

        Ok sorry for the late reply, but yeah the above worked great!!!

        Thanks

Answers are Closed

This question is closed to new answers.

Other Questions