Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#13568 closed defect (fixed)

When using the Editor with FindReplace plugin in a form tag with the HTML5 doctype, form values from the dialogs raise HTML5 form validation errors when trying to submit

Reported by: William Riley Owned by: Jared Jurkiewicz
Priority: high Milestone: 1.7
Component: Editor Version: 1.6.1
Keywords: Cc:
Blocked By: Blocking:

Description

The issue involves the new validation features in HTML5. I'm pretty certain the form is reading the aria-required/aria-invalid property from some of the form fields in certain editor plugins, preventing the form from being submitted, even though those fields don't get submitted with the form.

I'm pretty sure this happens in both FF and Chrome.

Rough sample case:

<!DOCTYPE html>
...
<form action="." ...>
    <div data-dojo-type="dijit.Editor" data-dojo-props="plugins: ['createLink']"></div>
</form>

Current workaround is to set the 'novalidate' property on the form, thus preventing the validation from stopping submission:

<form action="." novalidate="true" ...>

Attachments (1)

editorbug.html (1.1 KB) - added by William Riley 8 years ago.
Editor test case for bug involving HTML5 validation

Download all attachments as: .zip

Change History (13)

comment:1 Changed 8 years ago by bill

That's really weird/hard to believe since the TooltipDialog are moved to be direct children of <body>, and thus they are outside the <form>.

comment:2 Changed 8 years ago by William Riley

I was surprised too. If that doesn't work, I can give a more specific test case that I tried earlier today and confirmed that this was happening.

comment:3 Changed 8 years ago by bill

Yes, please attach the test case.

Changed 8 years ago by William Riley

Attachment: editorbug.html added

Editor test case for bug involving HTML5 validation

comment:4 Changed 8 years ago by William Riley

It seems that the FindReplace plugin is what's causing the problem. Looks like the form fields for that are inline with the editor rather than copied into the body, which would explain the behaviour. I probably should have narrowed it down before submitting the bug, sorry bout that.

Edit: also, I'm using Dojo 1.7b2, not sure if this happens in 1.6 or not.

Last edited 8 years ago by bill (previous) (diff)

comment:5 Changed 8 years ago by bill

Owner: set to Jared Jurkiewicz

No worries, did you figure out why it's invalid? aria-required/aria-invalid sound like valid fields to me.

Anyway, find/replace is Jared's plugin so assigning to him.

comment:6 Changed 8 years ago by bill

Summary: When using the Editor in a form tag with the HTML5 doctype, form values from the dialogs raise HTML5 form validation errors when trying to submitWhen using the Editor with FindReplace plugin in a form tag with the HTML5 doctype, form values from the dialogs raise HTML5 form validation errors when trying to submit

comment:7 Changed 8 years ago by William Riley

Oh, I didn't mean valid in the context of standards, I meant in the context of form validation:

http://diveintohtml5.org/forms.html#validation

comment:8 Changed 8 years ago by Jared Jurkiewicz

Is there a way to mark the fields as not to be validated?

comment:9 Changed 8 years ago by William Riley

I'm not sure how well implemented it is across browsers, but this may be useful:

http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#attr-fs-novalidate

comment:10 Changed 8 years ago by Jared Jurkiewicz

The mere presence of required on the field (or checkbox) causes it, even if the value is false. Will check in removing those attributes.

comment:11 Changed 8 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed

In [26194]:

Fix odd validation failure with HTML 5 and form validation. Cannot have required on the DOM at all, even if value is false. fixes #13568

comment:12 Changed 8 years ago by Jared Jurkiewicz

Milestone: tbd1.7
Note: See TracTickets for help on using tickets.