Form with tinyMCE textarea having html5 required attribute cannot submit -
this not question, answer want share you. i've spent on 4 hours tearing hair out on turns out bug in either tinymce or firefox.
with tinymce loaded, if specify html5 required
attribute on textarea
form not submit in firefox. no errors, nothing in firebug, stubborn refusal submit.
i don't know if ff or tinymce bug , don't care. don't want other coders go through aggravation i've gone through these last hours.
to ask question: bug documented anywhere? know?
if inappropriate post stack overflow, tell me , i'll delete it.
the problem far being firefox issue. indeed chrome , opera ("old" opera before "brain" transplanted chrome's) , every other modern browser give same headache.
with both opera , chrome, there's flag insisting field required one, (despite fact have content in it). chrome nice enough give error message in console:
an invalid form control name='<name of textarea>' not focusable.
not surprising when consider tinymce creates editable div
container, hiding original textarea
. hidden textarea
(bearing required
attribute) browser expecting provide value for.
over @ github, here: https://github.com/tinymce/tinymce/issues/2584, there suggested solution goes this:
// fix tinymce bug if($this.is('[required]')){ options.oninit = function(editor){ $this.closest('form').bind('submit, invalid', function(){ editor.save(); }); } }
i haven't tested snippet personally, studying might able going, long you're able drop right place.
Comments
Post a Comment