Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


get clicked value of a listbox

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,119
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> get clicked value of a listbox
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 get clicked value of a listbox - 6/6/2001 4:48:17 AM   
  subnation

 

Posts: 20
Score: 0
Joined: 5/22/2001
From: USA
Status: offline
Hello,

I have a list box filled with names. I want to be able to click on a name and display
the name in a message box.
Does anyone know how to do that?

for ex:

<script language-vbscript>
'userz is name of listbox
sub userz_onclick()
aa = window.frm1.userz.(what goes here?)
msgbox(aa)
end sub

</script>
 
 
Post #: 1
 
 Re: get clicked value of a listbox - 6/6/2001 4:50:09 AM   
  countryfun

 

Posts: 12
Score: 0
Joined: 5/31/2001
From: USA
Status: offline
To find the value of a selected list box, use the following:



<head>
<script language="javascript">
<!--
function HandleChange() {
var par1 =
document.formname.select.options[document.formname.select.selectedIndex].value;
alert(par1);
}
//-->
</script>
</head>

<body>
<select name="select" size="1" OnChange="HandleChange()">
<option value="test1">test1</option>
<option value="test2">test2</option>
<option value="test3">test3</option>
</select>
</body>

(in reply to subnation)
 
 
Post #: 2
 
 Re: get clicked value of a listbox - 6/6/2001 4:50:19 AM   
  countryfun

 

Posts: 12
Score: 0
Joined: 5/31/2001
From: USA
Status: offline
To find the value of a selected list box, use the following:



<head>
<script language="javascript">
<!--
function HandleChange() {
var par1 =
document.formname.select.options[document.formname.select.selectedIndex].value;
alert(par1);
}
//-->
</script>
</head>

<body>
<select name="select" size="1" OnChange="HandleChange()">
<option value="test1">test1</option>
<option value="test2">test2</option>
<option value="test3">test3</option>
</select>
</body>

(in reply to subnation)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> get clicked value of a listbox Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts