Show "Please Wait" after submitting a form

4 posts by 3 authors in: Forums > CMS Builder
Last Post: September 28, 2009   (RSS)

Not sure if this is PHP or JAVA or ?? but I'm trying to figure out how to replace the "Submit" button after it's been clicked by the user with "Please Wait" (and disable the button) while waiting for a response from another site that I've just sent a "POST" to.

It usually takes from 2 to 10 seconds for a 'response' from the other site and I don't want the user to keep clicking on the submit button.

Anyone have any ideas?

TIA!

Eric

Re: [eduran582] Show "Please Wait" after submitting a form

By Kenny - September 26, 2009 - edited: September 26, 2009

You can try a couple of options:

<input value="Submit" onClick="this.value = 'Please Wait!'">

or

<input type="submit" name="submit" onClick="this.disabled=true;">

or place this after your form

<script type="text/javascript">
function submitted() {
theButton = document.getElementById("submitbutton");
theButton.disabled = "disabled";
theButton.value = "Please Wait...";
}
</script>



Kenny

Re: [eduran582] Show "Please Wait" after submitting a form

By Dave - September 28, 2009

Hi Eric,

If you are comfortable with javascript or jQuery you could try this:
http://malsup.com/jquery/block/#page

You'd probably just need to load the javascript library and the top and add this (untested) code in the form tag:
<form ... onsubmit="$.blockUI()">

But it might take some experimentation.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com