FederalProgrammer
Programmer
I need to display at most 3 radio buttons depending on the logged-in user (silver members will get 1 radio button, while for a gold member there will be 2 radio buttons displayed and for plat members, there will be 3 radio buttons);
Radio buttons are displayed correctly; My problem is with the onclick function (a javascript function).
My gold and plat members have no problem. But silver members (w/ a single radio button) fail:
following javascript fails (for rdiChat.length = 1)!!
---------------
Radio buttons are displayed correctly; My problem is with the onclick function (a javascript function).
My gold and plat members have no problem. But silver members (w/ a single radio button) fail:
Code:
for ($i = 0;$i < count($rooms); $i++)
{
$result = mysql_query("SELECT * FROM rooms WHERE id={$rooms[$i]}");
$row = mysql_fetch_object($result);
$roomNum = $rooms[$i];
echo "<input type='radio' name='rdiChat' value='$roomNum' onclick = HandleChatroomSelected();>$row->name</a>";
}
following javascript fails (for rdiChat.length = 1)!!
Code:
var selectedChat = 'Donot know yet';
for (i = 0; i < document.chat.rdiChat.length; i++)
{
//this line doesn't get executed for rdiChat.length = 1:
document.write(document.chat.rdiChat.length);
if (document.chat.rdiChat[i].checked)
{
selectedChat = document.chat.rdiChat[i].value;
}
}
---------------