Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Dojo Dojo Radio Button

Related Tutorials


 
 

Share on Google+Share on Google+

Dojo Radio Button

Advertisement
In this section, you will learn how to create radio buttons in dojo. For creating radio button you need "dijit.form.CheckBox". The radio button do some action on press.

Dojo Radio Button

        

In this section, you will learn how to create radio buttons in dojo. For creating radio button you need "dijit.form.CheckBox". The radio button do some action on press. 

Try Online: Radio Button

The RadioButton class is declared in the CheckBox.js file, hence you need dojo.require(dijit.form.CheckBox) for RadioButtons to work.

[Radio buttons are used when there is a list of two or more options that are mutually exclusive and the user must select exactly only one choice from a group of radio button. Click a non-selected radio button will deselect whatever other button was previously selected in the list.]

Radio Buttons are the same as html but dojo provides more controls and styling options than a conventional Radio button. The radio button also contains Boolean types value either 'true' or 'false'. The following example creates a Radio buttons:

Here is the code of Program:

<html>
  <head>
  <title>Radio</title>
  <!-- radio -->
  <script type="text/javascript">
  dojo.require("dojo.parser");
  dojo.require("dijit.form.*");
  </script>
  </head>

  <body>
  <h2>Radio button</h2>
  <input dojoType="dijit.form.RadioButton" id="val1" name="group1" 
  checked=
"checked" value="Programmer" type="radio" />
  <label for="val1"> Programmer </label>
  <input dojotype="dijit.form.RadioButton" id="val2"  name="group1" 
 
value="Designer" type="radio" />
  <label for="val2"> Designer </label>
  <input dojotype="dijit.form.RadioButton" id="val3"  name="group1" 
  
value="Developer" type="radio" />
  <label for="val3"> Developer </label> 
  </body>
</html>

Output of Program:

 

Try Online:

 

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: November 1, 2008

Related Tutorials

Discuss: Dojo Radio Button   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com