Dreevoo.com | Online Learning and Knowledge Sharing
 
Home | Programs | Adobe Dreamweaver | Navigation | How to add Radio buttons in Dreamweaver
Guest
Click to view your profile
Topics
Programs
Languages
Recipes
Home
Shortcuts
 
 

How to add Radio buttons in Dreamweaver

You can visually insert a radio button into your form and set its properties. Use radio buttons when you want users to select only one choice from a set of options.

 
  Author: Pena | Version: CS5 | 22nd November 2013 |  
 
 
1.
 

Open HTML document.

 
 
2.
 

Click Forms and select Radio Buttons.

At Input Tag Accessibitity Attributes click OK. At Add form Tag? click OK.

 
 
3.
 

The button is created.

Now write something next to it. I wrote dreevoo.com.

 
 
4.
 

Create one more Radio button and write something next to it.

 
 
5.
 

Now we'll add a button which will perform a condition that we have set for the selected radio button.

Click Button.

 
 
6.
 

Select the button and select None under Properties.

 
 
7.
 

Write something in value field. I wrote Go to.

 
 
8.
 

The Form is created.

Now click Code.

 
 
9.
 

HTML code shows up.

Move bettween id="radio" and value="radio"...

 
 
10.
 

...and enter onClick="i=1".

 
 
11.
 

Now repeat the procedure for the second radio button. Only this time enter onClick="i=2".

 
 
12.
 

Move to the place where is part of the code for ordinary button (Go to).

 
 
13.
 

Enter onClick="gotoUrl()".

 
 
14.
 

Go to the end of the code. Behind </form>.

 
 
15.
 

Enter this part of the code:

<script>
function gotoUrl() {
 if (i==1) document.location='http://www.dreevoo.com';
 if (i==2) document.location='http://www.zmaga.com';
}
</script>


Use your own URL addresses.

 
 
16.
 

Rename type="radio2" to type="radio". Otherwise marks for the radio buttons will not be the same.

 
 
17.
 

Save the document (Ctrl + S) and press F12 to see your result.

Also recommended:


 
 
 
   
  Please login to post a comment
   
 
 
online learning made for people
Dreevoo.com | CONTRIBUTE | FORUM | INFO