Prevent Users from Submitting a Form Twice

This technique uses the client-side onclick event to disable the clicked subit button and update its button text. To test it out, go ahead and click the Submit button. It will become disabled and its text will change to “Submitted”. (Note: this page’s form doesn’t submit anywhere… but in a real example, the form submission would be occurring while the button is disabled…)

function DisableButton(b)
b.disabled = true;
b.value = ‘Submitting’;

Click the button to see how it can be disabled and
have its text changed when clicked…

<input type=”submit” name=”SubmitButton” id=”SubmitButton”
onclick=”DisableButton(this);” />




Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:


You are commenting using your account. Logout /  Ubah )

Foto Google+

You are commenting using your Google+ account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )


Connecting to %s

%d blogger menyukai ini: