$(".formcombobox :input[type=text]").each(function (i) {
this.onblur = function () {
var comboBox = $find(this.parentNode.parentNode.parentNode.parentNode.parentNode.id); // the combobox
if (jQuery.trim(comboBox.get_textBoxControl().value) == "") { // if textbox is empty
comboBox.set_selectedIndex(-1); // then set selected index to -1
}
}
});
Assuming the combobox has class="formcombobox", this attaches an onblur event to the textbox, and the set_selectedIndex() function triggers the change event, so this will correct the index when the user leaves a blank value and allow me to handle the change
I feel like there's probably a better way to get the parent but, whatever. It's good enough for me
I wonder if having a legitimate blank option would've went differently...