Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

combobox vbscript actual selected item

Posted on 2002-04-04
1
Medium Priority
?
2,647 Views
Last Modified: 2007-11-27
Hi,

I need to retrieve the value (The selected item - Not actual value) from the below combo box.
For an example: By Towns - when user select an item from combo box.  I am able to retrieve the value 2,
but I need actual selected item - "By Towns"


<SCRIPT LANGUAGE="VBScript">
function SelectRegionTowns(combobox)
msgbox  document.InfolineForm.cboRegion.selectedIndex
msgbox combobox.value
end function
</SCRIPT>



<td width="30%">
<SELECT NAME="cboRegion" OnChange="SelectRegionTowns(document.InfolineForm.cboRegion)"
size="1" tabindex="5">
<OPTION VALUE="1">Statewide: All Towns Selected
<OPTION VALUE="2">By Towns
<OPTION VALUE="3">By Region
<OPTION VALUE="4">By County
<OPTION VALUE="5">By LUW
</SELECT></td>


Thank you for any help that you will give

0
Comment
Question by:Salim_sam
1 Comment
 
LVL 4

Accepted Solution

by:
ckosloski earned 200 total points
ID: 6918309
Try this for your VBScript function,

<SCRIPT LANGUAGE="VBScript">
   function SelectRegionTowns(combobox)
      msgbox combobox.options(combobox.selectedIndex).text
   end function
</SCRIPT>


0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question