js checkout 全选 反选

来源:互联网 发布:手机淘宝代付 编辑:程序博客网 时间:2024/05/17 07:01
<script language="javascript">
function checkAllBox(boolValue)
{
var allcheck=document.getElementsByName("friendId");
for(var i=0;i<allcheck.length;i++)
if(allcheck[i].type=="checkbox")
    allcheck[i].checked=boolValue;
}

function selectAll()
{
var checkbox1=document.getElementById("selectAll");
if(checkbox1.checked==true )
{
checkAllBox(true);
}
else
{
checkAllBox(false);
}

}
function createMailbyme()
{
var ids =document.getElementById("reciverIds");
alert(ids.value);
alert(document.forms["createmail"].action);
document.forms["createmail"].submit();
}

</script>

<form method="POST" action="<@spring.url '/createmail'/>" name="createmail"  class="admailsend">
    <input type="hidden" name="reciverIds" id="reciverIds" value="20461416,9326848"/>

</form>

 <input type="checkbox" name="selectAll" id="selectAll" onClick="selectAll()"  />  <input type="button" name="sendMailButton" value="发送" onclick="createMailbyme()"/></p>


<input type="checkbox" name="friendId" value="${doc["id"]}" />
原创粉丝点击