单击后如何禁用提交按钮? [英] How to disable submit button once it has been clicked?

查看:38
本文介绍了单击后如何禁用提交按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在表单末尾有一个提交按钮.

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.

推荐答案

可能您提交了两次表单.删除 this.form.submit() 或在末尾添加 return false.

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

你应该得到 onClick="this.disabled=true; this.value='Sending...';"

这篇关于单击后如何禁用提交按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆