Form not working without JavaScript
-
The plugin does not degrace gracefully when using a form with JavaScript disabled.
Additionally, the event binding does not work with elements which are added to the page during or after the document.ready event. A better way would be to use delegation, which requires changing just one line of code in the plugin.
File:
js/mailing-front.jsjQuery('form').on('submit', function(e){Should be changed to:
jQuery(document).on('submit', 'form', function(e) {That will use event delegation, meaning the script will hook into any form that is submitted regardless of when its DOM element was created. I would submit a pull request, but was unable to find the plugin on GitHub.
Cheers, Danny
The topic ‘Form not working without JavaScript’ is closed to new replies.