Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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!?


Reply With Quote
  #2 (permalink)  
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?
Reply With Quote
  #3 (permalink)  
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)
Reply With Quote
  #4 (permalink)  
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?

Reply With Quote
  #5 (permalink)  
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
Reply With Quote
  #6 (permalink)  
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...

Reply With Quote
  #7 (permalink)  
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..
Reply With Quote
  #8 (permalink)  
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?
Reply With Quote
  #9 (permalink)  
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?
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 09:13 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.