Home - ngeshlew/responsive-html5-web-form GitHub Wiki
Welcome to the responsive-html5-web-form wiki!
Browsers which don’t support HTML5 attributes, addition of fallback scripts are embedded in the form.php file.
1. The fallback script for autofocus attribute is:
$(document).bind('autofocus_ready', function() {
if (!("autofocus" in document.createElement("input"))) {
$("#name").focus();
}
});
2. The fallback script for required attribute is:
var supportsRequired = 'required' in document.createElement('input');
$('[required]').each(function () {
if (!supportsRequired) {
var self = $(this);
self.removeAttr('required').addClass('required');
}
});
});