1
我不能够实现这些东西,在这个页面中我想做落实3两件事:选择和取消选择所有复选框
1>默认情况下,苹果和猫会在这个页面进行检查。 2>对于所有功能都将被检查和禁用。 3>对于STOPALL,所有的功能也将被默认(AC)值将被禁用,禁用*
<script type="text/javascript"> //This jquery is using for on selecting the checkbox,it will assign the text field of policyName and features
$(document).ready(function() {
$('.check').click(function(){
$("#policyName").val('Start');
$("#features").val('');
$(".check").each(function(){
if($(this).prop('checked')){
$("#policyName").val($("#policyName").val() + $(this).val());
$("#features").val($("#features").val() + $(this).data('name'));
}
});
});
});
</script>
这是我的jsp页面:
<div align="center" id="checkboxes">
<input type="checkbox" name="startall" data-name="Startall" class="check" id="check" value="all"> All
<input type="checkbox" name="stopall" data-name="Stopall" class="check" id="check" value="stopall"> STOPall
<input type="checkbox" name="apple" data-name="Apple" class="check" id="check" value="a"> Apple
<input type="checkbox" name="ball" data-name="Ball" disabled="disabled" checked="checked" id="check" value="b"> Ball
<input type="checkbox" name="cat" data-name="Cat" class="check" id="check" value="a"> Cat
<input type="checkbox" name="dog" data-name="Dog" checked="checked" disabled="disabled" id="check" value="d"> Dog
<input type="checkbox" name="elephant" data-name="Elephant" disabled="disabled" checked="checked" id="check" value="e">
Elephant
</div>
的任何援助....将被apprciated。
感谢您的快速回复;另外一件事是我正在使用文本框,现在的条件是如果选中该框,那么将显示数据名称以及此con文本上的任何输入。 – user1645434
完全没有问题:),文本框会显示在哪里?它会是每个项目的单独文本框 –
有单个文本框,在选择A,B,E时它会显示“StartABE”(这里的Start是选择全部 - >将显示“StartAll”选择停止它将显示“StopAll” – user1645434