How do I access a array checkbox with javascript? Also, I am creating the checkboxes within php. But I keep getting errors with the following code. Most of the html code is probably irreverent but I thought I would show it.
HTML
<h2>Pending CDISC Files</h2>
<table class="rounded-corner">
<form class="tasks" method="post" name="form_list" action="homepage.php">
<thead>
<tr>
<th class="topleft">ID</th>
<th>Family ID</th>
<th>Wave</th>
<th>Status</th>
<th>Comments</th>
</tr>
</thead>
<tr>
<p>
<td>
<input style="width:15px" type="checkbox" id="update" name="update" value="0"/>
</td>
<td style="display:none">
<input class="noneditable" style="width:20px" type="text" id="id" name="id" size="2" value="1" readonly="readonly" />
</td>
<td>
<input class="noneditable" type="text" id="familyid" name="familyid" size="4" value="1234" readonly="readonly" />
</td>
<td>3</td>
<td>
<select id="statusi" name="statusi" onChange="checkboxSetC(0)">
<option value="P" selected="selected">Pending</option>
<option value="RC">Received - Completed</option>
<option value="RI">Received - Incomplete</option>
<option value="RLO">Received - Lost by the Office</option>
<option value="NRNP">Not Received - No Participation</option>
<option value="NRLI">Not Received - Lost by Interviewer</option>
<option value="NRNR">Not Received - Not Required</option>
</select>
</td>
<td>
<textarea id="comments" name="comments" rows="2" cols="15" onChange="checkboxSetC(0)"></textarea>
</td>
</p>
</form>
</tr>
<tfoot>
<tr>
<td colspan="4" style="text-align:left">
Click to update changes you have made. Only select records will be updated.
</td>
<td>
<input type="submit" id="updatecdisc" name="updatecdisc" value="Update" />
</td>
Javascript
function checkboxSetC(i) {
eval("document.forms_list.update.checked = 1;");
return false;
}
Also available through this jsFiddle