Wednesday, 21 August 2013

How can I combine values of checkboxes with values of text in php?

How can I combine values of checkboxes with values of text in php?

I'm new with PHP, and I'm making a html form which consist basically in
two options: First, the client select a series of checkboxes (parts from
an equipment) and then write the amounts of each selected checkbox...
<td><input id="11.11.015.0002" name="pecas[]" type="checkbox"
value="11.11.015.0002 - BATERIA CHUMBO ACIDO 6V/4AH" /></td>
<td><input name="qntd[]" size="7" type="text" /></td>
and in php:
if(isset($pecas))
{
$mensagem .= "Peças Selecionadas:<br /><br />";
}
else {
echo "<script>alert('Selecione as Peças Desejadas!');
location.href='http://www.lyuz.com.br/pecas/erro';</script>";
exit;
}
foreach ($pecas as $pecas_s) {
} $mensagem .= " - ".$pecas_s."<br />";
That gave me all the selected checkboxes (parts), now I'm trying to get
only the input_text (amounts) associate with these selected checkboxes..
I'm stuck. Help.

No comments:

Post a Comment