IntelliJ Java IDE
The moose likes HTML, CSS and JavaScript and the fly likes select & focus method in selection lists Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "select & focus method in selection lists" Watch "select & focus method in selection lists" New topic
Author

select & focus method in selection lists

Davy Kelly
Ranch Hand

Joined: Jan 12, 2004
Posts: 384
hello everyone,
I am trying to use the focus methods and select methods in a selection list.
below is the code for everyone to help me see why it does not highlight the wages when i click yes or no.

some words may be spelled differently to be shown on javaranch.
Davy
[ April 21, 2004: Message edited by: Davy Kelly ]
[ April 21, 2004: Message edited by: Davy Kelly ]

How simple does it have to be???
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
onclick="document.myForm.wages.focus();"
you do not use select like that
Eric
[ April 21, 2004: Message edited by: Eric Pascarello ]
Davy Kelly
Ranch Hand

Joined: Jan 12, 2004
Posts: 384
Hi Eric,
You know I am doing distance learning, I have done java and now on the javascript part.
the code i have above is direct from what they are teaching me, but the material is made by a differnt company, they just use the program, if you get what i mean.
so what I did is straight from the material, so I don't understand what you mean by you don't use select like that?
davy
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
from my knowledge, I do not think there is a select() built-in function
there is: document.forms[0].dropDownName.selectedIndex = 1
Davy Kelly
Ranch Hand

Joined: Jan 12, 2004
Posts: 384
Yeah, I have emailed my distance learning tutor, to see what he says.
but I have done the one you mention above.
Davy
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 411
There is no slect method on "SELECT" element
2 select methods exist:
1.Highlights the input area of a form element on TEXTAREA and INPUT
2.Makes the selection equal to the current object - on TextRange and controlRange
 
 
subject: select & focus method in selection lists
 
Threads others viewed
raw HTML in Mozilla
How to activate the Radio button and select option
How to know the values displayed values changed or not in a jsp for update purpose
Help wanted on control select/option by javascript
help with radio buttons
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com