Solved

selectedIndex focus

Posted on 2000-04-18
4
218 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
  • 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 75 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
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…

803 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