Issue #2571755 by nod_, yched, mbaynton, drubb, swentel: Required text field with a Text Editor + AJAX form rebuild = unsubmittable form

8.0.x
Alex Pott 2015-09-26 16:37:37 +02:00
parent 93cd09f6cd
commit c72dc29476
1 changed files with 0 additions and 16 deletions

View File

@ -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.