Page 1 of 1

CreateRadioGroup

Posted: Fri Oct 28, 2005 12:09 pm
by ceilingfish
I am looking at the source for 10.3 and I can't find where the last argument addtext is used.

Code: Select all

function CreateInputRadioGroup($id, $name, $items, $selectedvalue='', $addttext='')
Looking at the others it seems to indicate an amount of text to insert inside the tag that's generated. Which I have been able to use to insert ids.

Does anyone know if this has been fixed anywhere? Or if I am being blind.

Cheers,
Tom

Re: CreateRadioGroup

Posted: Sat Oct 29, 2005 12:35 am
by Ted
Yeah, that's a bug.  I've committed the change to svn.  The function looks like:

Code: Select all

    function CreateInputRadioGroup($id, $name, $items, $selectedvalue='', $addttext='')
    {   
        $text = '';
        foreach ($items as $key=>$value)
        {   
            $text .= '<input type="radio" name="'.$id.$name.'" value="'.$value.'"';
            if ($addttext != '')
            {  
                $text .= ' ' . $addttext;
            }  
            if ($selectedvalue == $value)
            {   
                $text .= ' ' . 'checked="checked"';
            }  
            $text .= ' />';
            $text .= $key;
        }

        return $text;
    }
Thanks!