Radio.form

JavaScript 1.0+, JScript 1.0+ Nav2+, IE 3+, Opera3+ Syntax

							radio.form

Description

The form property of the Radio object is used to reference the Form object that contains the Radio box.

Example

Listing 7.436 shows an example of how the form property can be used to get the name of the form that contains the Radio object.

Listing 7.436 Example of the form Property
<html>
<head>
<title> Example of the radio form property</title>
</head>
<body>

<form name="form1">
<input type="radio" name=button1>Box 1
<br>
<input type="radio" name=button2>Box 2
<br><br>
<input type="button" value="Get Form Name"
  onClick='alert("The form name is: " + document.form1.button1.form.name)'>
</form>

</body>
</html>
							
							
						

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.