NYCPHP Meetup

[nycphp-talk] How to pass array when click on "submit" ?

chad qian nynj.tech at hotmail.com
Mon Jan 26 22:54:20 EST 2009



In "tbody",I can add or remove more "name[]","position[]","city[]","state[]" and "zip[]" through "add" or "remove" buttons.
On "create.php" page, I expect to show all like:
1.
name      
position
city
state
zip
2.
name      
position
city
state
zip
3.
name
position
city
state
zip
----------
--------
--------
How to program php script to pass all these above information?"name","position","city","state" and "zip" are all array.
 
Thanks!
 
chad
 
<form name="form1" method="post" action="create2.php">
<tr>
<td><strong>Step2: Board of directors:(Must have at least one)</strong></td>
<td>&nbsp;</td>
</tr>
<tbody id="dynamic_table_body">
<tr>
<td><label>Name:</label></td>
<td> <input type="text" name="bn[]" id="bn" /></td>
</tr>
<tr>
<td>Position:</td>
<td><label>
<select name="select[]" id="select">
<option value="president" selected>president</option>
<option value="vice president">vice president</option>
<option value="secretary">secretary</option>
<option value="others">others</option>
</select>
</label></td>
</tr>
<tr>
<td>City:</td>
<td><label>
<input type="text" name="city[]" id="city" />
</label></td>
</tr>
<tr>
<td>State:</td>
<td><label>
<input type="text" name="state[]" id="city" />
</label></td>
</tr>
<tr>
<td>Zip:</td>
<td><label>
<input type="text" name="zip[]" id="textfield3" />
</label></td>
</tr> 
<tr>
<td colspan="2"><button type="button" onClick="AddRow ();">Add </button></td>
</tr>
</form>
_________________________________________________________________
Windows Live™ Hotmail®:…more than just e-mail. 
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t2_hm_justgotbetter_explore_012009
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20090126/59c7d984/attachment.html>


More information about the talk mailing list