If I use HTML5 validation on form, button is disabled.
-
The bug is caused by js/form.js.
$( '.mw_wp_form input[type="submit"]' ).click( function() { if ( mw_wp_form_button_no_click ) { mw_wp_form_button_no_click = false; } else { $( this ).prop( 'disabled', true ); } } );
If the form is invalid, this code should not be executed, but the code is executed.
The quick solution is to fix this JavaScript as below.$( '.mw_wp_form input[type="submit"]' ).click( function() { var form = $('.mw_wp_form form')[0]; if(undefined !== form[0].checkValidity && !form[0].checkValidity()) { return; } if ( mw_wp_form_button_no_click ) { mw_wp_form_button_no_click = false; } else { $( this ).prop( 'disabled', true ); } } );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘If I use HTML5 validation on form, button is disabled.’ is closed to new replies.