PHP JQuery - Multiple fields post -
i looking advice on how this, concept confusing me. not looking exact solution, logic.
i have html form this:
| name | price | comment
which pass php script updates record inside database. problem being that, going going creating multiple entries (through jquery) , don't know how pass these 1 through php file. know can this:
<input type="name" id="name[]" value="" />
and handle each of posts array, and, can of fields inside form. there efficient way link them up?
for example:
if have 5 new rows array going be:
$_post['names'] = {"name1", "name2", "name3", ...} $_post['cost'] = {"cost1", "cost2", "cost3", ...} $_post['comments'] = {"comment1", "comment2", "comment3", ...}
i hope makes sense , can me!
this can done html alone, , values structured better suggest.
<form> <div class="row"> <input name="rows[0][name]"/> <input name="rows[0][price]"/> <input name="rows[0][comment]"/> </div> <div class="row"> <input name="rows[1][name]"/> <input name="rows[1][price]"/> <input name="rows[1][comment]"/> </div> </form>
then in php access $_request['rows']
, see contents.
Comments
Post a Comment