multiple textboxes

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 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-08-2008
Bob Bedford
 
Posts: n/a
Default multiple textboxes

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


Reply With Quote
  #2 (permalink)  
Old 03-09-2008
Jerry Stuckle
 
Posts: n/a
Default Re: multiple textboxes

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
==================

Reply With Quote
  #3 (permalink)  
Old 03-09-2008
petersprc
 
Posts: n/a
Default Re: multiple textboxes

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


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:34 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0