Solved

combobox vbscript actual selected item

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASP Classic - Load test 2 56
SMS AddAttachment Protocol Error Classic ASP 10 45
Button function on table is in trouble 3 22
Html value of radio 14 31
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 …
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

828 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