I have one strange question, and couldn't find answer or any clue for this, no matter how lame it seems... so need some help...
with PHP code I'm generating HTML form:
$html = '
<form name="manual" action="manual.php" method="post">
<table>';
$sql = "SELECT * from table;";
$result = pg_query($sql);
while ($row = pg_fetch_assoc($result))
{
$html .= '
<tr>
<td ><input type="text" id="cid'.$row['trans_id'].'" name="cids[]" value="'.$row['case_id'].'"/></td>
<td ><input type="text" id="ccid'.$row['trans_id'].'" name="ccids[]" value="'.$row['client_case_id'].'"/></td>
<td ><input type="checkbox" id="trnum'.$row['trans_id'].'" name="trs[]" value="'.$row['trans_id'].'"/></td>
</tr>';
}
$html .= '</table>
<input type="button" value="Submit" />';
which reproduces html form with multiple rows and some data with it:
...
<tr>
<td ><input type="text" id="cidrow1" name="cids[]" value="1" /></td>
<td ><input type="text" id="ccidrow1" name="ccids[]" value="4"></td>
<td ><input type="checkbox" id="trnumrow1" name="trs[]" value="row1"/></td>
</tr>
<tr>
<td ><input type="text" id="cidrow2" name="cids[]" value="2" /></td>
<td ><input type="text" id="ccidrow2" name="ccids[]" value="43"></td>
<td ><input type="checkbox" id="trnumrow2" name="trs[]" value="row2"/></td>
</tr>
<tr>
<td ><input type="text" id="cidrow3" name="cids[]" value="3" /></td>
<td ><input type="text" id="ccidrow3" name="ccids[]" value="32"></td>
<td ><input type="checkbox" id="trnumrow3" name="trs[]" value="row3"/></td>
</tr>
<tr>
<td ><input type="text" id="cidrow4" name="cids[]" value="4" /></td>
<td ><input type="text" id="ccidrow4" name="ccids[]" value="56"></td>
<td ><input type="checkbox" id="trnumrow4" name="trs[]" value="row4"/></td>
</tr>
...
I need user to make changes to two input text fields and once checked and verified to select check-box in same row where those two fields are located.
Once the user submits the form i have to check if all input fields belonging to selected check-boxes are filled (java-script should to trick here before form is sent back to server) and send back to server values from all selected check-boxes and corresponded input fields.
For example if in html form row 1, 3, 4 check-boxes are selected i need to get data from input fields of cid[], ccids[] and check-boxes for those rows.