Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
| Search | Today's Posts | Mark Forums Read
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript 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 December 2nd, 2004, 10:26 AM
Friend of Wrox
 
Join Date: Sep 2004
Location: Tehran, Tehran, Iran.
Posts: 103
Thanks: 0
Thanked 0 Times in 0 Posts
Default open single select object via javascript

hi all,
 How shall I open a single select HTML object(drop down combo box) through a javascript function?
note that I've already tried codes below: document.getElementById("mySelectBox").click();
document.getElementById("mySelectBox").click;
document.getElementById("mySelectBox").focus();
document.getElementById("mySelectBox").focus;
document.getElementById("mySelectBox").dragDrop();
document.getElementById("mySelectBox").dragDrop;
....
Help me out!?


 
Old December 2nd, 2004, 10:24 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

I do not believe this is possible.

-Snib - http://www.snibworks.com
Where will you be in 100 years?
 
Old December 3rd, 2004, 07:09 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

You can set the size and then reset it:
Code:
var oListbox = document.getElementById("mySelectBox");
oListbox.size = oListbox.options.length;
--

Joe (Microsoft MVP - XML)
 
Old December 4th, 2004, 02:43 AM
Friend of Wrox
 
Join Date: Sep 2004
Location: Tehran, Tehran, Iran.
Posts: 103
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks but changing the size will affect the alignment of other entities on the page. ain't there a better solution?

 
Old December 5th, 2004, 03:55 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hii nerssi,
Are you talking about how to make selected any items from the javascript function?If so then try this example
<script>
function setSelection(obj)
{
alert(obj.value)
obj1=document.getElementById("sel1")
obj1.selectedIndex=obj.value
}
</script>
<form name="test">
<input type=text name="mybox" onblur="setSelection(this)">
<select name="sel" id="sel1"><option value=1>1</option>
<option value=1>11</option>
<option value=1>111</option>
<option value=1>11111</option>
<option value=1>111111</option>
<option value=1>1111111</option>
<option value=1>11111112222222222222222</option>
</select>
</form>

Cheers :)

vinod
 
Old December 6th, 2004, 09:49 AM
Friend of Wrox
 
Join Date: Sep 2004
Location: Tehran, Tehran, Iran.
Posts: 103
Thanks: 0
Thanked 0 Times in 0 Posts
Default

NOOOO!
 I mean to open it!!
  thanks anyway...

 
Old December 26th, 2005, 10:26 AM
Registered User
 
Join Date: Dec 2005
Location: , , Brazil.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to nightdevil
Default

Nerssi, you could find a solution for this topic?
I also need to open a select to show for the user the options that he forget to select...

If you have a solution or anything related, send me a mail (in my profile)

Thanks..
 
Old February 3rd, 2006, 12:06 PM
Registered User
 
Join Date: Dec 2005
Location: , , Brazil.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to nightdevil
Default

hello, anybody know? Nerssi, where are you?
 
Old February 27th, 2006, 03:59 PM
Registered User
 
Join Date: Dec 2005
Location: , , Brazil.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to nightdevil
Default

Nerssi is online? could you see this post?




Similar Threads
Thread Thread Starter Forum Replies Last Post
Single quote in function Parameter ASP -Javascript Hem96 Classic ASP Professional 4 September 14th, 2007 09:10 AM
New window not being open by javascript akhilesh_g Classic ASP Professional 1 September 14th, 2007 04:13 AM
multi select open box dialog yourfriendahsan Visual Basic 2005 Basics 1 July 19th, 2007 02:49 PM
JavaScript open pop-up crmpicco Javascript How-To 1 June 10th, 2005 03:40 AM
select single node bcadmin BOOK: XSLT Programmer's Reference, 2nd Edition 1 November 10th, 2004 12:15 PM





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