The following is the script for the Radio Buttons. When you do it by yourself, then you will get an idea of using it. The below is the mentioned code :
Code:
<SCRIPT language="JavaScript">
function OnSubmitForm()
{
if(document.myform.operation[0].checked == true)
{
document.myform.action ="insert.html";
}
else
if(document.myform.operation[1].checked == true)
{
document.myform.action ="update.html";
}
return true;
}
</SCRIPT>
HTML Code:
<FORM name="form1" onSubmit="return OnSubmitForm();">
Name: <INPUT TYPE="TEXT" Name="name"><br>
Address: <INPUT TYPE="TEXT" Name="address"><br>
<input type="radio" name="operation" value="1" checked>Insert
<input type="radio" name="operation" value="2">Update
<P>
<INPUT TYPE="SUBMIT" name="Submit" VALUE="Save">
</P>
</FORM>
Bookmarks