Button that selects dropdown item?

I have a page on my site that allows people to sign up for a group. The majority of the page is pictures of the people who lead the group along with all the information about that group. Each group has a “Sign Up” button that takes them to the bottom of the page and a form for them to sign up for one of the groups. In the form I have a dropdown with all the different groups listed.

Here is my question…

Can I make it so that when they click the “Sign Up” button underneath the group they want, that it selects that group from the dropdown for them?

After fiddling with it and finding the right term to search on google I figured it out.

I made an onClick: event for each button which then uses this code to change the index of the dropdown to the right group.

$w(“#myDropdown”).selectedIndex = 0;

Actually this did not completely work. It does change the dropdown to display what i want but doesnt pass the information through to the database when the form is submitted. Anyone have any ideas on how to make this work?

Shamelessly trying to bring this back to the top in hopes that someone knows a way to make this work.

Did you bind the dropdown component to one of your datasets?

Eli, Thanks for the response. Yes I did. Works just fine if you manually click the item you want in the dropdown. However if I have one of the buttons select an item in the dropdown list it doesnt pass the selection to the database.