maas maas - 1 year ago 74
HTML Question

How to disable submit button once it has been clicked?

I have a submit button at the end of the form.

I have added the following condition to the submit button:

onClick="this.disabled=true;
this.value='Sending…';
this.form.submit();"


But when it moves to the next page, the parameters did not pass and null values are passed.

Answer Source

Probably you're submitting the form twice. Remove the this.form.submit() or add return false at the end.

you should end up with onClick="this.disabled=true; this.value='Sending…';"

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download