php - How to make my form sticky when the name field is an array -
i'm student in last quarter of school working on project. i'm using jquery allow addition of form fields on fly, have use arrays name field can collect information potentiall multiple fields same. i'd make said form fields sticky. i've searched google, searched stackoverflow , asked veteran developer husband (should have seen on face when i'd stumped him).
i writing code this:
<input type="text" name="trip_date[]" id="trip_date" value="<?php if(isset($_post['trip_date'])) { echo cleanstickystring($_post['trip_date']); }
what i'm unsure of, if $_post[trip_date] needs $_post[trip_date[]], though seems check see if array set.
any hint in right direction appreciated! honesty, haven't been able test yet because team mates haven't set database yet, because stumped husband, thought i'd jump on , see if out there had experience share. =/
thank time. know volunteer time others out, it's appreciated!
not sure mean "sticky", seems trying php render inputs added jquery (and values) after form submitted. right?
try this:
foreach($_post['trip_date'] $date) { echo '<input type="text" name="trip_date[]" value="' . $date . '">'; }
Comments
Post a Comment