Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 5th, 2004, 05:19 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Quote:
quote:Originally posted by Snib
 All right! :D

http://www.snibworks.com/examples/e001.php

I'm sure there's probably a tidier way to do this, but this is what I found

----------
---Snib---
----------
Nifty, couldn't you dispense with the second line of script?
Code:
function getselected()
{
 var sel = selbox.selectedIndex;
 //div1.innerHTML = sel;
 setTimeout("selbox.options[" + sel + "].selected = true;",0001);
}
--

Joe
 
Old March 5th, 2004, 05:56 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Oh. Yes, I suppose I could...

I'll try to remember to update my example page when I can, server's having an upgrade.

----------
---Snib---
----------
 
Old January 18th, 2005, 12:55 PM
Registered User
 
Join Date: Jan 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This works:).....

<html><head><title>Select Size</title>
<script>
function changeSize(Listbox, Size,type)
{
  Listbox.size = Size;
  var index=form1.select1.selectedIndex;
  form1.select1.options[form1.select1.selectedIndex].selected = true;
  form1.select1.multiple=type;

}

</script>
</head>
<body>
<form name="form1">
<select name="select1" onmouseout="changeSize(this, 2,false);" onmouseover="changeSize(this, 5,true);" multiple>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>

</select>
</form>
</body>
</html>







Similar Threads
Thread Thread Starter Forum Replies Last Post
font sizes in multiselect list mat41 CSS Cascading Style Sheets 2 June 3rd, 2007 06:30 PM
multi-column list box values moved to 2nd list box sbmvr Access VBA 1 May 14th, 2007 01:58 PM
How to get multiselect values from list box in jsp krishnamoorthymca JSP Basics 0 December 19th, 2006 02:13 AM
Moving Selected Items from a list box to excel AlanAtMars SQL Server 2000 2 August 19th, 2005 02:02 PM
MultiSelect List Box and Other issues... snoopy92211 Access VBA 0 July 14th, 2004 01:27 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.