grouped radio buttons should have the same name, i.e. avail not avail[].
This way you get a single variable which is always submitted but with a
value depending on the user's selection. The way you did it pases an array
with a single element, the value of this element (and maybe the key) will
vary. I'm not sure quite what your problem is or whether this will fix it
but it should help the form work as intended.

        Tim Ward
        Senior Systems Engineer

Please refer to the following disclaimer in respect of this message:
http://www.stivesdirect.com/e-mail-disclaimer.html


> -----Original Message-----
> From: Peter Houchin [mailto:[EMAIL PROTECTED]]
> Sent: 11 April 2001 06:30
> To: Php-General@Lists. Php. Net
> Subject: radio groups in loop form
> 
> 
> hiya,
> 
> I have a radio button in a loop with the rest of the form, 
> how ever when i go to do the mutliple update it clears all 
> but the updated radio buttons(rest of form data is fine just 
> the update on radio buttons) could some one pls give me an 
> idea why, when every thing else works propperly with the script
> 
> heres the code (only concerning the radio buttons)
> 
> <?
> if ($submit) {
> //echo "Values submitted via POST method:<br>";
> reset ($HTTP_POST_VARS);
> while (list ($key, $val) = each ($HTTP_POST_VARS)) {
>    //echo "$key => $val<br>";
> }
> reset($id);
> while (list ($key, $val) = each ($id)) {
>    //echo "Key: $key => Value: $val;<br>";
> 
> rs="update...
> rs .= "quote='".$quote[$key]."',";
> ...
> rs .= WHERE id='$id[$key];
> $result = mysql_query($rs,$db);
>       print mysql_error($db);
> 
>       } 
> }
> ?>
> 
> rest of form
> <input type="radio" name="avail[]" value="y" <? if ($avail == 
> 'y') { echo 'CHECKED'; }?>> // repeated line with 'n' & 
> 'pending' instead of 'y'
> 
> Peter Houchin
> [EMAIL PROTECTED]
> =========================================================
>      _____                              __   /\
>     /_/_/_\                            /  |_/  \
>    /_/_/_    __  __  __   __          /         \
>    \_/_/_\  /_/ /_/ /_/  /_/          \   _     /
>  ___\_\_\/ /_/_/_/ /_//\/_/            \_/ \/\_/
>  \_//_/_/ /_/_/_/ /_/ \/_/                    v
>      ________   ________________________________________
>     /_/_/_/_/  /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
>    /_/_ _/_/ ______  __   __  /_/ ____      __     ______
>   /_/_/_/_/ /_/_/_/ /_/  /_/ /_/ /_/\_\    /_/    /_/_/_/
>  /_/  \_\  /_/ _/  /_//\/_/ /_/ /_/__\_\  /_/___ _\_\_\
> /_/    \_\/_/_/_/ /_/ \/_/ /_/ /_/    \_\/_/_/_//_/_/_/
> =========================================================
> Telephone : (03) 9329 1455  Facsimile : (03) 9329 6755
> ************* We rent the dot in .COM!  **************
>  
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to