Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
80
rated 0 times [  86] [ 6]  / answers: 1 / hits: 32040  / 15 Years ago, fri, december 4, 2009, 12:00:00

I am using dijit.form.FilteringSelect to provide a way to select values from a <select>. The problem is, when using dojo, the label is returned instead of the value of the s.



For example:

<select name=test dojoType=dijit.form.FilteringSelect>

<option value=1>One</option>

<option value=2>Two</option>

</select>


Dojo is returning the literal one if that option is selected, instead of the value for that option, 1. The same is true for two and 2.



If dojo is removed from this element, the value is returned as expected.


More From » html

 Answers
61

I have found out that dojo creates 2 elements. One using the name, which contains the value which uses the NAME of the element, and another which contains the label for the option, which uses the ID of the element. Since I was using document.getElementById(), this was returning the wrong value. Using the value from the name provides the correct result.


[#98143] Wednesday, December 2, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kendellc

Total Points: 84
Total Questions: 97
Total Answers: 102

Location: Moldova
Member since Sat, Aug 6, 2022
2 Years ago
;