阅读背景:

为什么我的javascript阻止我多次选择一个单选按钮?

来源:互联网 

I would like to have a web donation form on my non-profit's website, and I would like people to be able to select a one-time gift or a monthly gift when they give via credit card. If they select a monthly gift, I would need to send some values to the payment processor, and a good way to do that seemed to be toggling the disabled attribute for the hidden form fields. I entered in two setAttribute() javascript functions for doing that, and two event listeners for clicking on the radio buttons. The problem is that adding those two functions and two listeners seems to have made it so that I can only click on the 'Monthly (Recurring) Gift' option once. The 'Single Gift' starts out checked, and if I then click on 'Monthly (Recurring) Gift' and then click on 'Single Gift', the browser won't let me select the 'Monthly (Recurring) Gift' option again. If I remove the javascript, it will let me do it. Why?I would like to have a web donation form on my




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: