-
How do you assign a url to the dropdown options in a combo box?
-
Hi,
labelarray=new Array("name1","name2","name3",etc);
dataarray=new Array("url1","url2","url3",etc);
for (i=0; i<numberofitems; i++) {
ComboBoxName.addItem(labelarray[i],dataarray[i]);
}
ComboBoxName.setChangeHandler("myHandler");
function myHandler(component) {
chosen = ComboBoxName.getSelectedItem().data;
getUrl(chosen,"",_POST);
}
Comboboxes use label,data to set.
label is the name that is shown in the combobox,
data is any further information.
SetChangeHandler uses the data assigned to a special label to work with.
Hope that helps!
manuel
-
for (i=0; i "smaller than" numberofItems; i++) {
ComboBoxName.addItem(labelarray,dataarray);
}
just to correct the code above...
Cause the display here makes errors, change "smaller than" with the sign that is correct, u know?
ok!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|