Loading
View RSS Feed

Angad Kumar Shukla's blog

Radio Button Validation using Javascript

Rating: 5 votes, 3.40 average.
Code:
<html>
	<head>
		<title>Javascript</title>
		<script type="text/javascript">
			function validate(){
				var value="";
				alert(frm1.r1[0].value);
				for(var indx=0;indx<frm1.r1.length;indx++)
					value=value+indx+":Checked "+frm1.r1[indx].checked+" Value: "+frm1.r1[indx].value;
				alert(value);
				var flag=validateName();
				return flag;
			}
			
		</script>
	</head>
	<body>
		<form name="frm1" onsubmit="return validate()">
			Name<input type="text" name="n1"><br>
			Gender: Male<input type="checkbox" name="r1" value="Male">
			Female<input type="checkbox" name="r1" value="Female">
			<input type="submit" name="submit" value="Go">
		</form>
	</body>
</html>

Submit "Radio Button  Validation using Javascript" to Digg Submit "Radio Button  Validation using Javascript" to del.icio.us Submit "Radio Button  Validation using Javascript" to StumbleUpon Submit "Radio Button  Validation using Javascript" to Google

Comments




Disclaimer: Users of techforum4u.com are responsible for ensuring that any material they post (article, blog posts, images or other mulitimedia content) does not violate or infringe upon the copyright, patent, trademark, or any personal or proprietary rights of any third party, and is posted with the permission of the owner of such rights.Anyone who violates these rules may have their access privileges removed without warning.