validateField function should return null if form is equal to null otherwise it generates this error "Cannot read property 'H5Form' of null"
The present codes between lines 140 to 142:
if(elem.form === undefined){
return null;
}
So when the form value is null it does return null instead generates this error "Cannot read property 'H5Form' of null"
Therefore it should be replaced with
if(elem.form === undefined || elem.form === null){
return null;
}
I guess elem.form === null
is needed only. But to be on the safer side we can check for both.
Can you just open a tracker and send a PR towards staging branch, it would be great.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-07-23 15:13:06 |
Labels |
Added:
?
Removed: ? ? |
Yes, if a field is not associated with a form and you call validateField on that then it return null,
https://github.com/joomla/joomla-cms/blob/staging/media/system/js/html5fallback-uncompressed.js#L141