function ddlList_Changed() {
var ddlList = jQuery('select[name*="ddlList"]');
var value = jQuery(ddlList).val();
alert(value);
}
The above shows an alert displaying ‘undefined’ whenever the dropdownlist’s selection is changed.
I’ve read around other scenarios were .val() has been undefined and suggestions were that the .val() needed to be called after the document is ready/has been fully loaded – but surely this is well past that stage anyway with it being only fired on selection changed?
NOTE: ddlList is not null, it initially selects it without any problems. The .val() seems to be the issue.
1 Answer