Hi Peter

I use this function in one of my scripts. Maybe you can get a few ideas from
it.

function WriteRadio ($FieldNo, $NOptions, $OptionValue, $Option,
$SelectedValue, $NullValue) {

        /*
        The Radio function writes a group of HTML INPUT radio buttons.
                $OptionValue = input value
                $Option = the option wording in the radio button group
                $SelectedValue = the option value that is currently checked
                $NullValue = the first option is empty if true (returns all
records for queries)
        */

        if ($NullValue) {
                echo "<INPUT type='radio' value='' name='f[".$FieldNo."]'>
N/A";
        }
        for ($i = 0; $i <= $NOptions[$FieldNo]; $i++) {
                if ($OptionValue[$FieldNo][$i] == $SelectedValue) {
                        echo "<INPUT type='radio'
value='".$OptionValue[$FieldNo][$i]."' name='f[".$FieldNo."]' checked>
".$Option[$FieldNo][$i];
                } else {
                        echo "<INPUT type='radio'
value='".$OptionValue[$FieldNo][$i]."' name='f[".$FieldNo."]'>
".$Option[$FieldNo][$i];
                }
        }
        return 0;
}

Rudolf Visagie
[EMAIL PROTECTED]

-----Original Message-----
From: Peter Houchin [mailto:[EMAIL PROTECTED]]
Sent: 12 April 2001 01:33
To: Php-General@Lists. Php. Net
Subject: [PHP] radio groups in looped form


hiya,

I have a script that repeats a form x number of times depending on how many
records there are, what's happening is when i go to update my radio buttons
it sees every radio button on the page as the ONE group when really it's x
number of groups (again depending on how many records there are)

How can i differ between raido groups with out having to get the name
changed for every record after the 1st one?

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