Solved

combobox vbscript actual selected item

Posted on 2002-04-04
1
2,296 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
Comment Utility
Try this for your VBScript function,

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


0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now