复选框 选择 全选

页面:

<td align="right">使用状态: <input type="checkbox" name="checkBox2"  onClick="selectAll('serviceModes','checkBox2')" title="全部选中或取消选中"/>
     </td>
  <td width="30%">
      <bean:define id="serviceMode" name="hardWareForm" property="serviceModeList"/>
          <html:select name="hardWareForm" property="serviceModes" multiple="true"  size="5" style="width:95%">
        <html:options collection="serviceMode" property="key" labelProperty="value" />
          </html:select>
      </td>

 

脚本:

//全选
function selectAll(s,boxname){
 var checked = false;
 var box = document.getElementById(boxname);
 if(box.checked){
  checked = true;
 }
 var b = document.getElementById(s);
 for(var i=0;i<b.length;i++){
        b[i].selected=checked; 
 }
}

 

var serviceModes = document.getElementById("serviceModes");
 for(var i=0;i<serviceModes .length;i++){
   if(serviceModes [i].selected){
  if(checkValues=="" || checkValues==null){
    checkValues = serviceModes [i].value; 
   }else{
    checkValues += "," + serviceModes [i].value;
  }
  }
  }

 

在action中直接获取

String[] serviceModes = (String[]) request
     .getAttribute("serviceModes");

 

在Axure中,要实现复选框的批量全选功能,可以按照以下步骤进行操作: 1. 首先,需要在Axure的页面中创建一个复选框和一个“全选”按钮。可以使用Axure的“复选框”组件,在页面上放置一个复选框控件,并命名为“复选框1”。然后,在页面上放置一个按钮组件,并命名为“全选按钮”。 2. 当“全选按钮”被选中时,需要将所有的复选框都选中。为此,需要在“全选按钮”的交互事件中添加一个交互动作。选择全选按钮”,在“交互”面板中,点击“添加事件”,选择“选中”→“选中状态”→“复选框1”。这样就可以实现当“全选按钮”被选中时,将“复选框1”设为选中状态。 3. 如果页面上有多个复选框复选框2、复选框3等),希望当“全选按钮”被选中时,所有的复选框都被选中,可以按照上述步骤依次为每个复选框添加交互动作,将它们都设为选中状态。确保每个复选框在对应的交互事件中被选中。 4. 最后,在使用Axure的预览功能预览页面,当点击“全选按钮”时,可以看到所有的复选框都被选中,实现了复选框的批量全选功能。 通过以上步骤,可以在Axure中实现复选框的批量全选功能。这样在需要批量选中复选框的情况下,用户只需点击一次“全选按钮”,就可以快速实现全选功能,提高了交互效率。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值