I am trying to change the text in the submit button on click. Trying to stop multiple submitters.
I have this in header.php:
<script type="text/javascript">
$("form.buttontext")
.submit(function() {
var $form = $(this);
$.post($form.attr('action'), function(){
var $submit = $form.find("input:submit").val('Processing');
window.setTimeout(function() {
$submit.val('Register Now');
}, 5000);
});
return false; //
});
</script>
also tried disabling submit on click:
$('input:submit').click(function(){
$('input:submit').attr("disabled", true);
});
Also tried this:
$(document).ready(function(){
$('#gform_submit_button_6').click(function(){
$('input:submit').attr("disabled", true);
});
});
Can someone please shed some light on where I am going wrong? I cannot get a click handler to work. I tried the submit handler too. No luck. I am obviously new to this and trying to learn!