[solved]php passing array
I'm confused about where to post this, as I'm working with a php array I want to pass to my javascript function. Anyways, this is my current php code:
Code:
$lidDb = new lidDb();
$lijst1 = $lidDb->getLidAll();
$j = 0;
while ($j < count($lijst1)){
echo "<tr><td><input type='checkbox' name='check[]' value=" . $lijst[$j]->getId() . "/></td>
<td>" . $lijst1[$j]->getId() . "</td>
<td>" . $lijst1[$j]->getNaam() . "</td>
<td>" . $lijst1[$j]->getSaldo() . "</td>
</tr>";
$j++;
}
?></table><p></table border=0><tr><td><label>Bedrag toe te voegen:</label></td><td><input type="text" name="toeTeVoegen" /></td></tr></tr>
<tr><td><input type="button" value="Toevoegen" onClick="toevoegenKostBijActiviteit(check[], toeTeVoegen);" /></td></tr>
The checked checkboxes need to be passed, so does the value from the textbox, it's meant to be some function where you check a few members, and add a certain amount of money to their current ... how to say in english. Balance or cash or whatever.
Here's what I had in javascript so far, this is a new thing to me btw (laugh at my noobness)
Code:
function toevoegenKostBijActiviteit(check[], toeTeVoegen)
{
alert(check[1]);
}
Thanks for feedback.:check: