Re: Undetermined number of radios to be 'remembered'

From: Date: Thu, 11 Oct 2001 19:07:07 +0000
Subject: Re: Undetermined number of radios to be 'remembered'
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-70845@lists.php.net to get a copy of this message
But how can I create an array from variables that I don't know what the names are going to be, only that they will be named 'peso_X', with 'X' being a random number, a random number of times? (At least it will not repeat). -- Julio Nobrega A hora está chegando: http://toca.sourceforge.net "Jason G." <blair@nb.net> wrote in message news:5.1.0.14.0.20011011150625.02e75f30@pop3.nb.net... Create an array with all of the peso_x numbers or whatever in it. Then serialize() the array and store it in a hidden field. WHen you get the page back, you can unserialize() the hidden field and have an array of peso_x's - so you know which fields are being sent back. Just an Idea. -Jason Garber IonZoft.com At 03:52 PM 10/11/2001 -0300, Julio Nobrega Trabalhando wrote: > Hi All, > > I have a form with radio buttons: > ><input type="radio" name="peso_<?php echo $infotec_id; ?>" >value="0"> ><input type="radio" name="peso_<?php echo $infotec_id; ?>" >value="1"> > > These radios come from a while loop that determine the $infotec_id >variable. So I have multiple buttons, with names like 'peso_1', 'peso_2', >'peso_3'. > > When submitted, and undetermined number of radio buttons named 'peso_X' >will be created. > > The X on 'peso_X' also is a value from a checkbox that goes along with the >radio buttons. Bigger picture: A checkbox with several 'pesos' attached to >it, so people can 'rate' the checkboxes they have marked. > > But if they submit the form, when they get back, the radio buttons that >they selected must be checked. > > I don't know how to do this with an undertermined number of radio buttons >labeled 'peso_X'. I know I should register what 'peso_X' in a session, so if >they hit back, the form 'remembers' what they have checked. But I can't >figure out how to know when the 'X' is 'X' so I can register a name that on >the form, will be remembered. > > Anyone have any ideas how I might do it? > >-- > >Julio Nobrega > >A hora está chegando: >http://toca.sourceforge.net > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net >For additional commands, e-mail: php-general-help@lists.php.net >To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#70845) next »