Javascript Example
Screen shot
Javascript radio button validation

<html>
<head>
<title>Javascript Example</title>
<script language="javascript" type="text/javascript">
function validate()
{
var str=true;

document.getElementById("msg").innerHTML="";

if(document.frm.gender[0].checked || document.frm.gender[1].checked)
{
str=true;
}
else
{
document.getElementById("msg").innerHTML="Please select gender";
str=false;
}

return str;

}
</script>
</head>

<body>
<form name="frm" action="" method="post" onSubmit="return validate();">
Male <input name="gender" type="radio" value="male" />
Female <input name="gender" type="radio" value="female" />
<div id="msg" style="color:#FF0000"></div>
<input name="btn" type="submit" value="submit">
</form>
</body>
</html>

You can download source code here