Commit c72dc294 authored by alexpott's avatar alexpott

Issue #2571755 by nod_, yched, mbaynton, drubb, swentel: Required text field...

Issue #2571755 by nod_, yched, mbaynton, drubb, swentel: Required text field with a Text Editor + AJAX form rebuild = unsubmittable form
parent 93cd09f6
......@@ -238,15 +238,6 @@
*/
Drupal.editorAttach = function (field, format) {
if (format.editor) {
// HTML5 validation cannot ever work for WYSIWYG editors, because WYSIWYG
// editors always hide the underlying textarea element, which prevents
// browsers from putting the error message bubble in the right location.
// Hence: disable HTML5 validation for this element.
if ('required' in field.attributes) {
field.setAttribute('data-editor-required', true);
field.removeAttribute('required');
}
// Attach the text editor.
Drupal.editors[format.editor].attach(field, format);
......@@ -275,13 +266,6 @@
*/
Drupal.editorDetach = function (field, format, trigger) {
if (format.editor) {
// Restore the HTML5 validation "required" attribute if it was removed in
// Drupal.editorAttach().
if ('data-editor-required' in field.attributes) {
field.setAttribute('required', 'required');
field.removeAttribute('data-editor-required');
}
Drupal.editors[format.editor].detach(field, format, trigger);
// Restore the original value if the user didn't make any changes yet.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment