0

我在 Rails 中使用引导程序时遇到了麻烦。

当我运行以下代码时,我只能选择一次单选按钮。

var ss = "<form accept-charset='UTF-8' action='/add_funds' \
class='simple_form new_fund' id='new_fund' method='post' \
novalidate='novalidate'> \
<input class='radio_buttons optional' id='fund_amount_1' name='fund[amount]' type='radio' value='1' /> \
<input class='radio_buttons optional' id='fund_amount_2' name='fund[amount]' type='radio' value='2' /> \
<input class='radio_buttons optional' id='fund_amount_3' name='fund[amount]' type='radio' value='3' /> \
<input class='radio_buttons optional' id='fund_amount_4' name='fund[amount]' type='radio' value='4' /> \
</form>";
$('.message-dialog-content').html(ss);

有关更多信息,请参阅此视频链接。

http://screencast.com/t/3D2Bxj6f37g

有什么帮助吗?

4

1 回答 1

0

我自己解决了这个问题。那是因为 jQuery 版本。我使用的是 jQuery 1.9.1,对一些方法(例如 jQuery 中的 attr 与 prop)进行了微小的更改。这是一个链接,您可以参考。修复使用 Rails 和 jQuery1.9.1 的问题

于 2013-04-10T11:50:19.560 回答