onclick禁用提交按钮 [英] onclick disable submit button

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

问题描述

我想在onc​​lick时禁用提交按钮.我无法禁用该按钮,但我无法将发布值提交给php.

i wanna disable a submit button when onclick. im able to disable the button but i cant submit the post value to php.

推荐答案

我在网上找到了替代方案.我所做的是创建一个假的禁用和隐藏按钮.单击实际按钮时,我将其隐藏并显示伪造的禁用按钮.

i found a alternative online. wat i did is to create a fake disable and hidden button. when the actual button is clicked, i will hide it and show the fake disable button.

实际按钮:

$onclick = "
var boolconfirm = confirm('$strconfirmattempt');
if(boolconfirm==true){
finishattempt.style.display='none';
finishattempt2.style.display='inline';
}
return boolconfirm;";

假按钮:

echo "<input type=\"submit\" name=\"finishattempt\" value=\"submit\" onclick=\"$onclick\" />.
<input type=\"submit\" id=\"finishattempt2\" name=\"finishattempt2\" value=\"submit\" style=\"display:none;\" DISABLED/>\n";

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

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