jquery - failing form validation forces user to refresh page before submit works -
because ie < 10 doesn't support required
html form attribute, had use jquery check form blank form fields. problem is, when user clicks submit , required
error message pops up, unable place value in field , click submit
. instead, have refresh page in order submit button work again. way user doesn't have refresh page after failed validation?
$('html body input#create.btn').click(function() { $('select').each(function() { if ($(this).val() < 1) { $(this).focus(); $('#required-warning-label').remove(); $(this).parent().append('<span id="required-warning-label" class="label label-warning">required</span>'); stopsubmit = true; return false; } }) if (stopsubmit) return false; })
update code to
$('html body input#create.btn').click(function() { stopsubmit = false; $('select').each(function() { if ($(this).val() < 1) { $(this).focus(); $('#required-warning-label').remove(); $(this).parent().append('<span id="required-warning-label" class="label label-warning">required</span>'); stopsubmit = true; return false; } }) if (stopsubmit) return false; })
Comments
Post a Comment