Page 1 of 1

Javascript function returning "undifined"

Posted: Thu Mar 08, 2007 5:37 am
by impulse()
I know only the very basics of Javascript so I'm unable to read this function that's not working within my code. At the moment it just returns "undifined". Could somebody please tell me if there's an error contained within. The SQL inside is all working fine, as far as I can see.

Code: Select all

function group_desc(){

        <?
        $query_get_groups = 'SELECT *
                             FROM groups ORDER BY group_name';

        echo 'var descs= new Array()
        descs["none"]="Please select a group to view its description...";';
        $result_get_groups = mysql_query($query_get_group, $linkCppAdsl);
        while($row=mysql_fetch_array($result_get_groups)){
                echo 'descs["'.$row['groupID'].'"]="'.$row['group_description'].'";';
                $group_select=$row['group_select'];

                $result_group_get = mysql_query($group_select, $linkCppAdsl);

                $emails=array();

                while($row_group_all = mysql_fetch_array($result_group_get)){
                        $contact_id=$row_group_all['roles_contactID'];

                        $query_email="SELECT email
                                      FROM contact_email, contacts
                                      WHERE contactID = {$contact_id}
                                      AND roles_contactID = contactID
                                      AND default_email = 'Y'";

                        $result_email = mysql_query($query_email, $linkCppAdsl);
                        $row_email = mysql_fetch_array($result_email);
                        $contact_email=$row_email['email'];
                        $to.=$contact_email.', ';
                }
                echo 'adds["'.$row['groupID'].'"]="'.$to.'";';

        }?>
        setter = document.groups.group_name.value;
        settee = document.groups.group_more;
        settee.value = descs[''+setter+''];
}

Posted: Thu Mar 08, 2007 6:45 am
by onion2k
What does Firebug say?

Posted: Thu Mar 08, 2007 8:06 am
by feyd
The function doesn't return anything. :?