travisbrown
Technical User
- Dec 31, 2001
- 1,016
It seems to me that this should work. I'm not getting an error, and values seem to be passing through, but still nothing happens.
Can someone see something obviously wrong?
When a checkbox is clicked, the function checks the value against an array. If true, it should display a table row.
Can someone see something obviously wrong?
When a checkbox is clicked, the function checks the value against an array. If true, it should display a table row.
Code:
<input type="checkbox" name="arr_groups_id" value="31" onclick="checkGroupForEList(this.value);" />
<tr id="row_elist" style="display:none;">
<td>...</td>
<td>...</td>
</tr>
function checkGroupForEList(group_id) {
if ( checkArray(group_id,'30,31,38') )
document.getElementById('row_elist').style.display = '';
}
function checkArray(matchVal,theArray)
{
var match=false;
var myArray= new Array (theArray)
for (i=0;i<myArray.length;i++)
{
if (myArray[i]==matchVal)
{
match=true;
}
}
return match;
}