3
I have a form with some items, and some cells contain the bank code data and account code to receive.
In the same cell I have 2 inputs
distinguished, one checkbox
and a hidden
. I need to iterate and get the values of all checkboxes
that are marked, including field value hidden
cell. This field is the code of the database to generate the ticket.
That means you can have more than one account receivable from the same bank. I need after iterate send each incoming account to your due ticket.
Below is an excerpt of the code:
<form id="frmGrid">
<table>
<tr>
<td>
<input type="checkbox" name="chkboleto" value="119" checked />
<input type="hidden" name="hdn_banco" value="001" />
</td>
<td>
<input type="text" name="name" />
</td>
<td>
<input type="text" name="lastname" />
</td>
</tr>
<tr>
<td>
<input type="checkbox" name="chkboleto" value="120" />
<input type="hidden" name="hdn_banco" value="001" />
</td>
<td>
<input type="text" name="name" />
</td>
<td>
<input type="text" name="lastname" />
</td>
</tr>
<tr>
<td>
<input type="checkbox" name="chkboleto" value="130" checked/>
<input type="hidden" name="hdn_banco" value="100" />
</td>
<td>
<input type="text" name="name"/>
</td>
<td>
<input type="text" name="lastname" />
</td>
</tr>
<tr>
<td>
<input type="checkbox" name="chkboleto" value="140" checked/>
<input type="hidden" name="hdn_banco" value="100" />
</td>
<td>
<input type="text" name="name" />
</td>
<td>
<input type="text" name="lastname" />
</td>
</tr>
</table>
Very good example. In addition to helping me a lot it made me go to the Jquery api to study what you used in the resolution example you gave me. If it’s not too much I’d like you to tell me how to generate more than one ticket for a bank.
– Fininhors
@Fininhors what is "boleto"? in Portugal we do not use that name.
– Sergio
Boleto bancário, is a document that has a value to be paid in a bank(local fisico) or by internet banking.
– Fininhors
@Fininhors means you want to generate one more
<form>
and send to the server?– Sergio
I want to say that I need to take the Hidden.value and this.value code pairs and generate a document. For each Hidden.value you take these values of chekbox and generate your document. Got it??
– Fininhors
@Fininhors the variable
checked
in my example there is this. Do you want to generate this in PHP or Javascript? for the database or for the client... I don’t quite understand. Maybe I should ask another question so you have more room to explain– Sergio
@Sergio If I understand correctly, he basically wants to make one
ajax
for eachcheckbox
.– Maicon Carraro