Solved

combobox vbscript actual selected item

Posted on 2002-04-04
1
2,358 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 50 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

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…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

770 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