Code: JavaScript Fallback for the HTML5 required attribute

Since the Safari browser doesn’t show a notice for empty input elements attached with the required attribute, a JavaScript fallback using the alert() function can be used instead.

I took the liberty to enhance the following solution to to its use of the deprecated jQuery.browser property, and having it coded for testing purposes only.

Please use the following code instead:



Published by

Yaniv Friedensohn

Yaniv Friedensohn is a marketing developer trying to merge his programming capabilities and online marketing knowledge towards maximizing marketing performance. You can contact him at [email protected]