# getSelectedIndex() & setSelectedIndex()

**URL:** <https://forum.kirupa.com/t/getselectedindex-setselectedindex/228127>\
**Category:** flash\
**Created:** [June 5, 2007, 3:50pm UTC](https://forum.kirupa.com/t/getselectedindex-setselectedindex/228127 "2007-06-05T15:50:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Denise032](https://avatars.discourse-cdn.com/v4/letter/d/9e8a1a/32.png) [@Denise032](https://forum.kirupa.com/u/Denise032)\
**Post date:** [June 5, 2007, 3:50pm UTC](https://forum.kirupa.com/t/getselectedindex-setselectedindex/228127/1 "2007-06-05T15:50:23Z")

</div>

**OK, here’s the foundation** :

I have a booking form. In this booking form I have two combo boxes. The first combo box asks the user to select when their event starts, the second combo box asks the user to select when their event ends.

**Here is what I want** :

I need to have the second combo box have a starting value of the first combo box.

**For example** : if the users event starts at 1pm, they will select from the drop down in the first combo box, 1pm, therefore, I would like the second combo box to have a starting value of 1pm.

Now, I understand I would need to do this with getSelectedIndex() & setSelectedIndex(), however, I’m not quite sure how to write the code telling combobox2 to start it’s value at whatever combobox1 is on…can any1 give me a little kickstart? :lol:
