This is a discussion on multiple textboxes within the PHP Language forums, part of the PHP Programming Forums category; Hi all, I do build an item list using a SQL query. I'd like the person being able to ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi all,
I do build an item list using a SQL query. I'd like the person being able to define a quantity for each item using an input type="text" in the list the reuse it when the datas are passed to an other script. The problem is how to name the text as they can be passed to an other script ? Thanks for helping. Bob |
|
|||
|
Bob Bedford wrote:
> Hi all, > > I do build an item list using a SQL query. I'd like the person being able to > define a quantity for each item using an input type="text" in the list the > reuse it when the datas are passed to an other script. The problem is how to > name the text as they can be passed to an other script ? > > Thanks for helping. > > Bob > > > Not knowing the results of your query, it's impossible to say. But I would suggest a unique name for each textbox based on the unique id returned in your query. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|||
|
Hi,
You can use the array style: <? foreach ($items as $it) { ?> <input name=qty[<?= $it['id'] ?>] type=text> <? } ?> You can read the submitted values back like so: foreach ($_REQUEST['qty'] as $id => $val) { echo "Item $id has quantity $val.<br>" } Regards, John Peters On Mar 8, 6:26 pm, "Bob Bedford" <b...@bedford.com> wrote: > Hi all, > > I do build an item list using a SQL query. I'd like the person being able to > define a quantity for each item using an input type="text" in the list the > reuse it when the datas are passed to an other script. The problem is how to > name the text as they can be passed to an other script ? > > Thanks for helping. > > Bob |
![]() |
| Thread Tools | |
| Display Modes | |
|
|