Re: [PHP] selected index

2005-10-25 Thread Sascha Braun
Hi, just take a look at this function: http://www.php.net/manual/en/function.array-keys.php __ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 -- PHP General Mailing

Re: [PHP] selected index

2005-10-25 Thread Adrian Bruce
dont know of a function but this should work $size = count($array); for($i=0;$i<$size;$i++){ if($selected_person == $array[$i]){ echo"index: $i"; } } Adrian Ross wrote: Hi, I have an array $people= array ("ross", "bob", "chris") I have a variable $selected_person = "chris"

[PHP] selected index

2005-10-25 Thread Ross
Hi, I have an array $people= array ("ross", "bob", "chris") I have a variable $selected_person = "chris" I want to do the find out the index of the $selected_person in the $people array. Is there a function that can do this?? ta, Ross -- PHP General Mailing List (http://www.php.net/) T

Re: [PHP] selected

2001-04-25 Thread Vivre Draco
This probably isn't the most elegant method either, but this is how I did it: function mark_sel($value, $option) { // Compare the actual value ($value) to a possible value ($option) to determine // if the possible value should be marked as "selected" in a form element. if ($value == $optio

Re: [PHP] selected

2001-04-25 Thread Wade
I am sure my solution is not the most elegant, but this is what I did: ALABAMA ?> ""Hasbullah Pit (sebol)"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I have this one :- > > > Penuh > Sep

[PHP] selected

2001-04-25 Thread Hasbullah Pit (sebol)
I have this one :- Penuh Separuh Sendiri and a field of table which contained with 'Penuh' OR 'Separuh' OR 'Sendiri' I want to make it Ither one is 'selected' during a particular time. i'm thinking of having something like this:- >Penuh >Sepa

Re: [PHP] Selected Radio Buttons

2001-04-14 Thread Jordan Elver
Hi, The $article_active comes from a session and I want be able to select the radio button (which ever one, yes or no) when the user comes back to the page. I think thats a bit clearer :-) Jord On Saturday 14 April 2001 15:12, you wrote: > I'm not sure I understand. In the first loop you are s

Re: [PHP] Selected Radio Buttons

2001-04-14 Thread Plutarck
I'm not sure I understand. In the first loop you are seing if $article_active equals y. And no where in the code do you set $article_active to anything else. Why would you think $article_active would be anything but "y" or "n"? -- Plutarck Should be working on something... ...but forgot what it

[PHP] Selected Radio Buttons

2001-04-14 Thread Jordan Elver
Hi, I think I'm being stupid. Why won't this code work. The $article_active variable is showing y when I echo it? if($article_active == 'y') { echo"Yes"; } else { echo"Yes"; } if($article_active == 'n') { echo"No"; } else { echo"No"; } Thanks, Jor

Re: [PHP] selected option values not being captured by form processing software

2001-03-13 Thread Chris Lee
your checking the value every time you loop so that you can see if that value is checked or not. Im sure Ive missunderstood your question... please email. select_array('', 'country', ''); echo " "; foreach($result as $pos => $val) { $this_country = $val['country']; echo " $t

[PHP] selected option values not being captured by form processing software

2001-03-13 Thread Nicole Lallande
Hi, Working on a code that uses a select/option field. All my other fields are passing through to the form processing software just fine. Meloni's PHP Essentials does this funky thing, declaring each function value as selected or not although she shows it with the individual values not with var

Re: [PHP] selected = true

2001-01-22 Thread Richard Lynch
> Hey all. Does anyone have any ideas how I can carry over a selected value? > :) It's probably easy but my mind is making it difficult. A value is > stored for a record in the DB which had been previously assigned through a #get all the possible options into an array $options $options = array

[PHP] selected = true

2001-01-22 Thread Jason Jacobs
Hey all. Does anyone have any ideas how I can carry over a selected value? :) It's probably easy but my mind is making it difficult. A value is stored for a record in the DB which had been previously assigned through a select statement. If that record gets edited, the value that was chosen thr