Gossamer Forum
Home : General : Internet Technologies :

Javascript highlight element (was: Perl Newbie)

Quote Reply
Javascript highlight element (was: Perl Newbie)
I have taken over a project that was coded in Perl. I am learning to love this language but have encountered a problem that has taken me 4 days to work -out, or not work - out Mad. Here is my situation. I have a asp page that searches for "positions available" and it returns a certain number of "positions" in a ScrollingList. I need to highlight (focus) the first selection (option) in the scrollinglist. Can anyone help me, I appreciate any idea's. Thank you!

Last edited by:

Wil: Dec 5, 2002, 1:36 AM
Quote Reply
Re: [AnneMarieK] Perl Newbie In reply to
You can't do it in perl but you can with javascript after generating the list.

document.form_name.select_element.elements[0].selected = true;
Quote Reply
Re: [Paul] Perl Newbie In reply to
Thanks for answering so quicklySmileSmile

Question: 1)So I can I have this when the page is loaded?

2) and the select_element is what? I am not familiar with Javascript at all!

3) Do I then also have to set the form_name?
Quote Reply
Re: [AnneMarieK] Perl Newbie In reply to
Actually, hold on a sec, the first option is always selected anyway isn't it?

Last edited by:

Paul: Dec 4, 2002, 2:41 PM
Quote Reply
Re: [AnneMarieK] Perl Newbie In reply to
If you want to actually highlight the element aside from just selecting it then see attached.

Last edited by:

Paul: Dec 4, 2002, 2:43 PM