Re: [PHP] Form Processing - Multiple inputs of the same name
This worked perfectly. Thank you. As for the FAQ, I looked, but I guess not in the right place! Mike "Tracy Finifter Rotton" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Change the name of your checkboxes in your HTML to something like: > > name="DeleteIDs[]" > > This will make it an array, and you can access all the elements like > > $_POST['DeleteIDs'][0] > > etc. > > > > (This should really be in a FAQ somewhere...) > > -- tracy > > On 1/31/03 11:17 AM, "Mike Potter" <[EMAIL PROTECTED]> wrote: > > > Is it possible to pass an group of input boxes of the same name, then get > > the values of all the checked boxes or filled out textboxes? > > How do I get ALL the IDs passed. Right now it only passes the last ID. Do > > I really have to give them all unique names? > > > > For example... > > > > > > > > > > > > > > Jon Smith > > David Callow > > Peter Parker > > . > > . > > . > > > > > > > > > > > > This list of DeleteIDs will be build dynamically. I want the user to be > > able to check the boxes they want to delete and pull the IDs on the posted > > page. > > > > How do I get ALL the IDs passed. Right now it only passes the last ID. > > > > Thanks, > > > > Mike > > > > > > -- > Tracy F. Rotton > [EMAIL PROTECTED] > http://www.taupecat.com/ > > "... I like the 49ers because they're pure of heart, > Seattle because they've got something to prove, > and the Raiders because they always cheat." > -- Lisa Simpson, "Lisa the Greek" > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form Processing - Multiple inputs of the same name
On Fri, 31 Jan 2003, Tracy Finifter Rotton wrote: > Change the name of your checkboxes in your HTML to something like: > > name="DeleteIDs[]" > > This will make it an array, and you can access all the elements like > > $_POST['DeleteIDs'][0] > > etc. > > (This should really be in a FAQ somewhere...) Using arrays with forms is in a faq: http://www.php.net/manual/en/faq.html.php#faq.html.arrays How do you feel this should be expanded? Mentioning that unchecked checkboxes do not pass values, and that the default value is 'on' (if checked) ... would be good too. I remember posting some information on this topic in the past: http://marc.theaimsgroup.com/?l=php-general&m=101142826821051 http://marc.theaimsgroup.com/?l=php-general&m=98576486229922 Anyway, I agree, just not sure if there should be one specific faq for each form type, such as checkboxes or select boxes or... Ideally one faq would explain it for all types, checkboxes or otherwise. Making it short/concise and understandable for all user levels (such as newbies) is the tricky part. Well, actually, the tricky part is convincing people to read faqs :) Regards, Philip > On 1/31/03 11:17 AM, "Mike Potter" <[EMAIL PROTECTED]> wrote: > > > Is it possible to pass an group of input boxes of the same name, then get > > the values of all the checked boxes or filled out textboxes? > > How do I get ALL the IDs passed. Right now it only passes the last ID. Do > > I really have to give them all unique names? > > > > For example... > > > > > > > > > > > > > > Jon Smith > > David Callow > > Peter Parker > > . > > . > > . > > > > > > > > > > > > This list of DeleteIDs will be build dynamically. I want the user to be > > able to check the boxes they want to delete and pull the IDs on the posted > > page. > > > > How do I get ALL the IDs passed. Right now it only passes the last ID. > > > > Thanks, > > > > Mike > > > > > > -- > Tracy F. Rotton > [EMAIL PROTECTED] > http://www.taupecat.com/ > > "... I like the 49ers because they're pure of heart, > Seattle because they've got something to prove, > and the Raiders because they always cheat." > -- Lisa Simpson, "Lisa the Greek" > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form Processing - Multiple inputs of the same name
Change the name of your checkboxes in your HTML to something like: name="DeleteIDs[]" This will make it an array, and you can access all the elements like $_POST['DeleteIDs'][0] etc. (This should really be in a FAQ somewhere...) -- tracy On 1/31/03 11:17 AM, "Mike Potter" <[EMAIL PROTECTED]> wrote: > Is it possible to pass an group of input boxes of the same name, then get > the values of all the checked boxes or filled out textboxes? > How do I get ALL the IDs passed. Right now it only passes the last ID. Do > I really have to give them all unique names? > > For example... > > > > > > > Jon Smith > David Callow > Peter Parker > . > . > . > > > > > > This list of DeleteIDs will be build dynamically. I want the user to be > able to check the boxes they want to delete and pull the IDs on the posted > page. > > How do I get ALL the IDs passed. Right now it only passes the last ID. > > Thanks, > > Mike > > -- Tracy F. Rotton [EMAIL PROTECTED] http://www.taupecat.com/ "... I like the 49ers because they're pure of heart, Seattle because they've got something to prove, and the Raiders because they always cheat." -- Lisa Simpson, "Lisa the Greek" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Form Processing - Multiple inputs of the same name
Is it possible to pass an group of input boxes of the same name, then get the values of all the checked boxes or filled out textboxes? How do I get ALL the IDs passed. Right now it only passes the last ID. Do I really have to give them all unique names? For example... Jon Smith David Callow Peter Parker . . . This list of DeleteIDs will be build dynamically. I want the user to be able to check the boxes they want to delete and pull the IDs on the posted page. How do I get ALL the IDs passed. Right now it only passes the last ID. Thanks, Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php