First of all, I apologize if I've posted this in the wrong forum. If so, could a moderator please move it.
Now to my dilemma. I am trying to develop a textbox and a dropdown, where the value of the textbox is dependent on the option selected from the dropdown.
For the dropdown I wanted to use the autocomplete feature and found a widget that does it (from here: Link)
For the textbox dependency I am using Javascript.
The problem I face is that when using the autocomplete widget, on selecting an option, it is not triggering an onchange event in the select (dropdown). And I need this onchange event for my textbox to be filled in.
There is also a button on the page, which lets you the original select box.
I have put the code for my page below. I'm also using some CSS which I have added at the end.
// pass empty string as value to search for, displaying all results
input.autocomplete( "search", "" );
});
input.tooltip({
tooltipClass: "ui-state-highlight"
});
},
_destroy: function() {
this.wrapper.remove();
this.element.show();
}
});
})( jQuery );
$(function() {
$( "#combobox" ).combobox();
$( "#toggle" ).click(function() {
$( "#combobox" ).toggle();
});
});
CSS part (new.css)
.ui-combobox {
position: relative;
display: inline-block;
}
.ui-combobox-toggle {
position: absolute;
top: 0;
bottom: 0;
margin-left: -1px;
padding: 0;
/* support: IE7 */
*height: 1.7em;
*top: 0.1em;
}
.ui-combobox-input {
margin: 0;
padding: 0.3em;
}
I hope I have been able to explain this properly. Could someone please help me figure out how to trigger the onchange event? And if can't be done, is there another way to do what I want?