Can anyone help me troubleshoot a small issue with my Dojo code? I want to disable a button if the value selected from a dropdown matches a specific value. What am I missing in my implementation?
Example
var myCode = "CC";
dojo.addOnLoad(function() {
dojo.connect(dojo.byId('#codes'), "onchange", function(evt) {
var selCode = this.val();
if (selCode == myCode) {
dojo.attr('#submit', disabled);
}
dojo.stopEvent(evt);
});
});
<select name="codes" id="codes" class="codes">
<option selected="selected" value="">Select Below</option>
<option value="AA">AA</option>
<option value="BB">BB</option>
<option value="CC">CC</option>
<option value="DD">DD</option>
</select>