-
combobox small problem...
i have a swf that has 2 combo boxes (rooms & adult) and a button.
first combo loads when tha page is loaded...code
roomsCombo.dataProvider = [{label:"0", data:"0"}, {label:"1", data:"1"}, {label:"2", data:"2"}, {label:"3", data:"3"}, {label:"4", data:"4"}, {label:"5", data:"5"}];
second one loads on change event of rooms:
for (i=parseInt(_root.roomsCombo.value);i<=(parseInt(_ root.roomsCombo.value)*3);i++) { _root.adultCombo1.addItem({label:i, data:i}); }
and user select the adult combo
on change event of that capture both values to vars:
_global.roomsTemp = this.selectedIndex;
_global.adultTemp = adultCombo.selectedIndex;
and presses btn to goto next page...
and when the user wants to come back pressing the back button, when he comes the values he selected shoud be shown again...
so i put a if condition for the loadpage event to check the var is already filled.
rooms can be done.
roomsCombo.selectedIndex = _global.roomsTemp;
but becouse the adults depends on rooms
if (_global.adultTemp != undefined) {
_root.adultCombo.removeAll();
//_root.adultCombo.selectedIndex = _global.adultTemp;
for (i=_global.roomsTemp; i<=((roomsTemp)*3); i++) {
_root.adultCombo1.addItem({label:i, data:i});
//trace(i)
}
_root.adultCombo1.value= _global.adultTemp;
}
but...the results are not as expected..
pls some one can see the code and advice me
thanks
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
|