Ultra fast cheap  linux and windows hosting
javascript tutorial Browse Basic JavaScript Tutorial
Browse JavaScript Script resources
Browse javascript FAQS
Categories:

javascript tutorial
buy template
Home >> Tutorials >> Advanced javascript tutorials
Automatically Selected Disable/Lock Radio Button
Radio Button Links validate radio button


A radio button is a circular button on your web page that can be selected by the user.

How to create a radio button
The tag to put a radio button on your web site is <INPUT TYPE="RADIO" NAME="yes" VALUE="1">. Yes

Automatically Selected

Sometimes you want a radio button is already selected when the user loads the page. To automatically select a radio button, add the line CHECKED to the <INPUT TYPE="RADIO" NAME="agree" VALUE="yes"> tag .

<INPUT TYPE="RADIO" NAME="agree" VALUE="yes" CHECKED>Yes.
Yes
No

Disable Radio Button

Some times you don't want the users to edit the radio button selection.You can do this by Disabling a radio button. Disabling a radio button means that the radio button is grayed out . To disable a radio button, add the line DISABLED to the <INPUT TYPE="RADIO" NAME="agree" VALUE="yes"> tag so the final result looks like


How to make Radio Button Links:

Place the following code between the <head> </head>.

<SCRIPT LANGUAGE="JavaScript" >
<!-- hide
function load(url) {
window.location.href =url;
}
</script>

Now to make radio button links put the following code between <body> </body>.

<form name="testform">
<input type="radio" name="rb" onClick="load('cbeg.htm');">Checkbox examples
<input type="radio" name="rb" onClick="load('http://www.itechies.net/developers.htm');"> Developer zone
<input type="radio" name="rb" onClick="load('mailto:info@itechies.net');"> contat us
</form>

Checkbox examples
Developer zone
contat us


Page contents: itechies.net - Learn how to make Radio Button Links,disable a radio button
javascript tutorial
javascript book
Buy this book