This is supposed to be a client list, where you click the rows to select them and then submit them to database for cron job to pick them up and send email to them.
I’m trying highlight rows instead of using checkboxes, thats why I put two hidden elements
one for the client id, other – bool for checking if row has been clicked or not.
What I can’t figure out is how to toggle the specific row’s element value(checked).
<table>
<tbody>
<tr class="contactrow">
<input type="hidden" name="id" value="995"/>
<input type="hidden" name="checked" value="FALSE"/>
<td>Andrew Ostrich</td>
<td>AO Company</td>
<td>7537535</td>
<td>ao@aocompany.com</td>
</tr>
<tr class="contactrow">
<input type="hidden" name="id" value="296"/>
<input type="hidden" name="checked" value="FALSE"/>
<td>Brendon Evans</td>
<td>Institute of Modern Arts</td>
<td>648648468</td>
<td>bevans@ioma.co.uk</td>
</tr>
<tr class="contactrow">
<input type="hidden" name="id" value="421"/>
<input type="hidden" name="checked" value="FALSE"/>
<td>Rudy Thompson</td>
<td>Marine CORP</td>
<td>95939288</td>
<td>Rudee@mcorp.es</td>
</tr>
</tbody>
</table>
Also,
http://jsfiddle.net/FHjAc/
Part of the problem is that the server won’t be able to identify which client ids has been checked. All of the
input[type=checkbox]share the samenameattribute, which is what is used to identify each parameter.If you change the
nameattribute tochecked[__ID__], then you can loop over the parameters and submit those records to the database.In PHP you would do the following.
Update
I didn’t realize you were using a hidden input for the checked field. If you change it to a checkbox you’re job should be a lot easier.
HTML This is how I would markup my HTML, you can use CSS to hide the checkbox with
display: none.jQuery