if you cant chage method[] suggest you identify the check box by another method
for example
PHP Code:
<body>
<form name="profile" id="profile" >
<input type="checkbox" name="method[]" value="payroll_onetime">A Another
<input type="checkbox" title="grp1" name="method[]" value="payroll_onetime">Payroll
<input type="checkbox" title="grp1" name="method[]" value="payroll_onetime">One-time
<input type="checkbox" title="grp1" name="method[]" value="paper">Paper Check
<input type="checkbox" title="grp1" name="method[]" "onlinebill">Online Bill
</form>
Note there are other form and HTML I removed.
So my problem is this. I'm trying to access the method checkbox array from a JS function. So I write:
<script language="JavaScript" type="text/javascript">
<!--
function setPayrollStatus(){
grp1Ary=new Array();
myips=document.getElementById('profile').getElementsByTagName('INPUT');
for (i=0;i<myips.length;i++){
if (myips[i].getAttribute('title')){
if (myips[i].title=='grp1'){
grp1Ary[grp1Ary.length]=myips[i];
}
}
}
grp1Ary[0].checked=true;
}
setPayrollStatus()
//-->
</script>
Bookmarks