Results 1 to 1 of 1

Thread: [solved]php passing array

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2007
    Posts
    115

    [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.
    Last edited by frederik; Apr 23rd, 2009 at 07:10 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width