Hello, I am using AJAX to load a control into 2 different spans on a page. I need to know how to get the selected values
I am calling a JS function onclick of the button
[CODE]function get_droplist_users()
{
//need to know how to access each of the values here. An alert would suffice
}
Here is the HTML
[CODE]
<form name=”frm_generic”>….
<tr>
<td valign=”top”>
<span id=”reg_users”><select name=”drp_users” onchange=”createCookie( ‘ActiveUser’, this.options[ this.selectedIndex ].value );”>
<option value=””>– Select a User –</option>
<option value=”2″>Glenn</option>
<option value=”4″>Jef</option>
<option value=”3″ selected=”selected”>Tim</option>
</select>
</span>
</td>
<td>
<span id=”reg_users2″><select name=”drp_users” onchange=”createCookie( ‘ActiveUser’, this.options[ this.selectedIndex ].value );”>
<option value=””>– Select a User –</option>
<option value=”2″ selected=”selected”>Glenn</option>
<option value=”4″>Jef</option>
<option value=”3″>Tim</option>
</select>
</span>
</td>
</tr>
<tr>
<td>
<input class=”btn_Save” name=”btn_Save” id=”btn_Save” onclick=”get_droplist_users();” value=”Save” type=”button”>
</td>
</tr>
If you can give me a way to alert each of the values of the 2 droplists in my function onclick of the button that would rock. I have tried a few things but really have no idea how to do this using two fields of the same name…I was hoping I could get to the value through the different IDs in the spans (reg_users and reg_users2)
Normally I only use this control once on a page and just access the cookie I set, but since I am naming the cookie inside the control itself, I am basically over riding the cookie before it. SO I just want to access the value instead of the cookie in this instance.
Thank you for any help with this