Get Dojo radio button value?

I have an HTML form using dojo and there is the following code to select a radio button selector:

dojo.require("dijit.form.RadioButton");
<link href="http://ajax.googleapis.com/ajax/libs/dojo/1.6.2/dojo/resources/dojo.css" rel="stylesheet" />
<link href="http://ajax.googleapis.com/ajax/libs/dojo/1.6.2/dijit/themes/claro/claro.css" rel="stylesheet" />
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.9.3/dojo/dojo.js" djConfig="parseOnLoad:true"></script>

<body class="claro">
  <input type="radio" dojoType="dijit.form.RadioButton" name="infoUrgent" value="deferrable" id="deferrable">Deferrable
  <input type="radio" dojoType="dijit.form.RadioButton" name="infoUrgent" value="immediate" id="immediate">Immediate
  <br>
Run code

I want to get the value of this switch and pass it to my "backend" script, but NOT onClick or onChange, only after the user clicks the "Submit" button that I received on the form. Usually with text fields, etc. I can just use dijit.byId ('id'). Value or .attr ('value'), but since the switches have different identifiers, I cannot use this. Docs from dojocampus mention the use of the switch name ... I am having trouble getting this to work ... can I get some help?

Thanks.

+5
2

dijit.form.Form HTML- myForm.attr('value'). infoUrgent, myForm.attr('value'), , myForm - dojo ( dijit.byId ..).

+9
require(["dojo/query"], function(djQuery){
        var retreiveSelected = function() {
        return djQuery('input[type=radio][name=infoUrgent]:checked')[0].value;
    };
})
+3

All Articles