?
Solved

selectedIndex focus

Posted on 2000-04-18
4
Medium Priority
?
225 Views
Last Modified: 2008-01-09
Hiyas,
Is there a way to scroll to  the selectedIndex of a select list if it's not being shown in the visible rows? I'm using size="4" on the <select> and the option list is much longer than that.

I'm building the list and setting a 'selected' option with ASP.  That's all fine.  The correct option is showing up highlighted...it's just not immediately visible sometimes.

This has to work in Netscape too by the way.
0
Comment
Question by:WrrX
[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
  • 2
4 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 2725856
Not possible in netscape - known bug.

In IE the
document.myForm.mySelect.selectedIndex = 10;
should scroll to the 10th entry

Michel
0
 
LVL 1

Accepted Solution

by:
Faxe earned 300 total points
ID: 2726591
Since you're working with asp, why don't you try working around it by changing the sort order of the multiple select box.
the items marked that are selected are places at the top of the list instead of at their regular position (like alphabetical)...

<OPTION SELECTED>3</OPTION>
<OPTION SELECTED>6</OPTION>
<OPTION SELECTED>9/OPTION>
<OPTION> </OPTION>
<OPTION>1</OPTION>
<OPTION>2</OPTION>
<OPTION>4</OPTION>
<OPTION>5</OPTION>
<OPTION>7</OPTION>
<OPTION>8</OPTION>
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 2727055
Hmm - and use javascript to rewrite the order of the select on later changes... If the user won't be confused about the order - why not...

Michel
0
 

Author Comment

by:WrrX
ID: 2728804
Sometimes the most obvious things escape me :)  Thanks for the extra info too Michel.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

765 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