Solved

combobox vbscript actual selected item

Posted on 2002-04-04
1
2,446 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBScript on Html 15 65
Update the value of table B with value of table A tables inner join 6 102
Two decimal 5 43
VB script help 23 50
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…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

751 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