FederalProgrammer
Programmer
I have 3 types of Accounts and for each of them different count of radio buttons should be displayed:
I display the radio buttons and assign an onclick event handler in php using the following code:
and here's the definition of the HandleChatroomSelected()
---------------
Code:
Silver = 1 radio button should be displayed
Gold = 2 radio buttons should be displayed
Platinum = 3 radio buttons should be displayed
I display the radio buttons and assign an onclick event handler in php using the following code:
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>";
}
and here's the definition of the HandleChatroomSelected()
Code:
function HandleChatroomSelected()
{
var selectedChat = 'Donot know yet';
// in here, document.form.rdiChat is undefined, when there is only a single radio button
//but it works when I have more than 1 radio buttons on document.form
for (i = 0; i < document.form.rdiChat.length; i++)
{
if (document.form.rdiChat[i].checked)
{
selectedChat = document.form.rdiChat[i].value;
}
}
//...more code in here ...
}
---------------