Open TheCopacabanaMan opened 9 years ago
Do you think there will be any news on this?
@victorjonsson Hi so what is going on now about this issue? can not be sovled?
Please tell me asap. This feature is important to me .Thanks.
Actually I also faced the similar problem. although my editor is not TinyMCE.
Here is a quick and dirty fix http://jsbin.com/durelucehi/edit?html,output
What you need to do is to set validateHiddenInputs
to true
when setting up the validation.
$.validate({
validateHiddenInputs: true
});
And also add the following script making sure that the textarea content is up to date when the form gets submitted.
function updateTextAreasWithContentFromTinyMCE() {
$('textarea').each(function() {
var content = getTinyMCEContentForTextarea(this);
if (content !== undefined) {
$(this).val(content);
}
});
}
function getTinyMCEContentForTextarea(textareaElem) {
var id = textareaElem.id || textareaElem.name;
for (i=0; i < tinyMCE.editors.length; i++) {
if (tinyMCE.editors[i].id == id) {
return tinyMCE.editors[i].getContent();
}
}
return undefined;
}
$('form').on('submit', updateTextAreasWithContentFromTinyMCE);
The best thing would be to have a module fixing all this for you (and that doesn't require you to set validateHiddenInputs to true)
Note: catch the blur event of the editor (tinymce.dom.Event.add(editor.getDoc(), 'blur') and trigger blur on the textarea-element
I'm trying to integrate Validator with TinyMce TextArea, but validation is not working. Normal TextArea (without TinyMce) is working pretty good, but when i transform TextArea to TinyMce->TextArea, validator is not working. Is it possible integrate TinyMce? Thank you very grazie :)