Si je mets
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
<script type="text/javascript">
$(
function()
{
$('#officeItemList').combobox(
{
comboboxContainerClass: "comboboxContainer",
comboboxValueContainerClass: "comboboxValueContainer",
comboboxValueContentClass: "comboboxValueContent",
comboboxDropDownClass: "comboboxDropDownContainer",
comboboxDropDownButtonClass: "comboboxDropDownButton",
comboboxDropDownItemClass: "comboboxItem",
comboboxDropDownItemHoverClass: "comboboxItemHover",
comboboxDropDownGroupItemHeaderClass: "comboboxGroupItemHeader",
comboboxDropDownGroupItemContainerClass: "comboboxGroupItemContainer",
animationType: "slide",
width: "150px"
});
});
</script> |
Mon menu deroulant est nickel (design) mais le onchange ne marche pas
si je mets
1 2 3 4 5
|
function changeSelect() {
var num_selected = $('#officeItemList').val();
alert (num_selected);
} |
et
<select id="officeItemList" onchange="changeSelect()">
le onchange fonctionne.
mais si je mets les deux pour avoir à la fois le Onchange et le design nickel, ça ne fonctionne plus. Etant vraiment débutant en js j'imagine que l'erreur vient de moi.
Sauriez-vous me dire où est l'erreur ? J'ai codé comme ça :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
function changeSelect() {
var num_selected = $('#officeItemList').val();
alert (num_selected);
}
$(
function()
{
$('#officeItemList').combobox(
{
comboboxContainerClass: "comboboxContainer",
comboboxValueContainerClass: "comboboxValueContainer",
comboboxValueContentClass: "comboboxValueContent",
comboboxDropDownClass: "comboboxDropDownContainer",
comboboxDropDownButtonClass: "comboboxDropDownButton",
comboboxDropDownItemClass: "comboboxItem",
comboboxDropDownItemHoverClass: "comboboxItemHover",
comboboxDropDownGroupItemHeaderClass: "comboboxGroupItemHeader",
comboboxDropDownGroupItemContainerClass: "comboboxGroupItemContainer",
animationType: "slide",
width: "150px"
});
}); |
et comme ça :
<select id="officeItemList" onchange="changeSelect()">
merci
Partager