i want a code for a question with 4 choices using radio buttons

Recommended Answers

All 5 Replies

Hi Adiga!

Its not a problem to have 4 radio buttons.
But you are not clearly stating what exactly you want.

Please clarify what you exactly want

Regards

Rupam

whats the code for radio buttons

Hey Adiga

Just try the following code if there is something you dont understand feel free to ask someone or me would explain

//JavaScript Code for radio Button

var chkStatus = false;

for(var x = 0; x < document.frmGames.optStatus.length; x++)
 {
       if(document.frmGames.optStatus[x].checked)
        {
	chkStatus = true;
	alert("Current team status is " +
		document.frmGames.optStatus[x].value);
        }else if(chkStatus == false){
	alert("Please select a team status");
	return false;
       }else{
             alert("Form values are valid");
            return true;		
      }
}


//HTML Code for Radio Button

<tr>
      <td>&nbsp; Pending&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio"  
              name="optStatus" checked value="PENDING"></input></td>
     <td>&nbsp; Played&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" 
             name="optStatus" VALUE="PLAYED"></td>
      <td>&nbsp; Cancelled&nbsp;&nbsp;<input type="radio" name="optStatus"          
             VALUE="CANCELLED"></td>
</tr>

thanks Traicey :)

Anytime...... anyway I havent forgot about what we talked about in the last few weeks, I hope that u did understant my code coz to tell the truth for me to understand someone's code takes some while let alone when I have no idea what the code does

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.