I have a submit button, i need this button to be disabled after only one click , and it should be not disabled if there are validation errors. i am using the following,
onclick="var e = this; setTimeout(function () { e.disabled = true; e.value='Please wait...'}, 0); return true;"
but this makes the button remain disabled if there are validation errors which i don't want.
here is the submit button code
<input type="submit" onclick="var e = this; setTimeout(function () { e.disabled = true; e.value='Please wait...'}, 0); return true;" value="Confirm Selected" />
How do i achieve this using jquery
or JavaScript
?
Note: I have looked into stack overflow questions, but the answers don't handle when there is a validation errors.