Get "Value" from Dijit option, Yeah Right...

Discussion created by citizens on Aug 10, 2010
Latest reply on Apr 10, 2013 by mgaigg-esristaff
Once again I have spent too much time working on this to feel intelligent any longer.

I've implemented a dijit.form.ComboBox, followed by a dijit.formButton:

The idea here is after the user selects a "displayed value" in the combobox, they click the button and fire off a function that does something based on the "value" of the selected item (<option value="someValue">).

I can get the "displayedValue" all day long and have found many ways to do that, but I simply cannot get inside the option to get the value of its attribute "value."

I've read more dijit and dojo reference than I care to admit and have tried everything I can find on the web, but to no avail.

It is kicking my @$$.

Please help!!

Thanks a million.

function getData(){
var selectedVal =  {can't figure this part out};
if (selectedVal == "expired") {
do this;}
else if (selectedVal == "4") {
do this;}
else if (selectedVal == "future") {
do this;}

<div id="dropDown">
<select dojoType="dijit.form.ComboBox" id="selBox" class="dropSlam" value=" Select...">
<option value="expired"> Alex</option>
<option value="expired"> Bonnie</option>
<option value="4"> Colin</option>
<option value="future"> Danielle</option>
<option value="future"> Earl</option>
<option value="future"> Fiona</option>
<option value="future"> Gaston</option>
<option value="future"> Hermine</option>
<option value="future"> Igor</option>
<option value="future"> Julia</option>
<option value="future"> Karl</option>
<option value="future"> Lisa</option>
<option value="future"> Matthew</option>
<option value="future"> Nicole</option>
<option value="future"> Otto</option>
<option value="future"> Paula</option>
<option value="future"> Richard</option>
<option value="future"> Shary</option>
<option value="future"> Tomas</option>
<option value="future"> Virginie</option>
<option value="future"> Walter</option>


<button dojoType="dijit.form.Button" type="button" onClick="getData();">Retrieve Data