Forum OpenACS Development: Firefox 4 and new Form Validation "Features" (or is that bug!)

I have just run into a problem which taxed me for a few minutes when I couldn't submit an openacs form (an xowiki photo.form to be precise) because the 'section' field and the 'image' field were suddenly behaving as required fields even though their default is required:false. Confusing because when I uploaded my first 240 test objects the fields were *not* required!

It turns out that Firefox 4 has introduced form validation features as a default feature of the browser. This seems strangely intrusive and presumptive, and now requires that we modify form builder to add either a 'novalidate' attribute to our form or a 'formnovalidate' attribute to our 'submit' control.

Quite why Mozilla think they know what every database in the world wants and needs I can't imagine. The requirement for data is without doubt a decision that lies in the domain of the data model, not the Mozilla codebase. But there it is.

So as things currently stand, the form builder from the version of OpenACS I am running is no longer compatible with the latest version of Firefox. What a nightmare!

Some background information:

http://blog.oldworld.fr/index.php?post/2010/11/17/HTML5-Forms-Validation-in-Firefox-4

OpenACS behaves as expected in IE9.

Regards
Richard

Richard,

Is this true for html 4 also, or is firefox adding the validation default only for html 5 specified pages?

Torben

No, that's the bug - it doesn't respect the document header and has this turned on anyway! That's just SO bad!!

Same for Chrome.

R.

Is it true that this concerns whole OpenACS or is it specific to Xowiki?
The problem for xowiki is that (in conjunction with certain versions of Tdom only, I think) it adds required=false to elements that are meant to be not required. Which is erroneous since required is a boolean attribute, which means its presence indicates true, absence false.
Does the form builder outside xowiki also add a required attribute?
Yep, there it is:

<input type="text" size="80" id="F.en:photo246._page_order" name="_page_order" value="" required="false">

....and no, other forms outside xowiki do not have this added.

OK, so really this needs to be removed since it is not a correct rendition of the HTML standard anyway, and it has no place in an HTML 4 document.

I will hunt it down!

Thanks for the tip.

R.

This is really bad.

We can not include the novalidate attribute for pages that use the HTML4 doctype, which is the default DTD in OpenACS, or we won't be able to claim WCAG2-AA anymore.

Have you reported it to mozilla?

Not yet. But maybe Michael's comment above deserves some careful evaluation before we do.

Is that to say that a simple change in xowiki might resolve this? I have not tested other forms, I made the mistake of assuming that xowiki simply used the vanilla form-builder behaviour.

Hopefully when Gustaf reads this he will know exactly what to suggest we do.

R.

in firefox, the interpretation of boolean attributes has changed. update xowiki and the problem should be gone.
Oh brilliant. Thank you. I was just searching through html_procs.tcl to find the appropriate bit of code.

On reflection I should really have tried an update before posting. Sorry for any inconvenience.

Regards
Richard

Just to confirm a cvs update has fixed this.

R.