也许是因为它是一个单选按钮。
尝试将其更改为复选框?
单选按钮不喜欢被选中,如果没有其他检查:
<input type="radio" value="0" name="duration">
<input type="radio" value="1" name="duration">
<input type="radio" value="2" name="duration">
<input type="radio" value="3" name="duration">
和独立
<input type="radio" value="0" name="other_name">
在另一方面复选框取消选中对方:(注名是阵列等)
<input type="checkbox" value="0" name="duration[]">
<input type="checkbox" value="1" name="duration[]">
<input type="checkbox" value="2" name="duration[]">
<input type="checkbox" value="3" name="duration[]">
和独立
<input type="checkbox" value="0" name="other_name">
你可以写这样的事情有一个独立的复选框的能力,亦自单选按钮的甜头:http://jsfiddle.net/LJJrZ/
$(document).ready(function(){
var selector = "input[type=checkbox]";
$(selector).click(function(event){
var checked = $(this).is(':checked');
if (checked) {
$(selector).attr("checked", false);
$(this).attr("checked", true);
}
});
});
你使用jQuery UI的日期选择器? – Rafay