Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to remove used items in drop down list using Java

Status
Not open for further replies.

korssane

IS-IT--Management
Jun 3, 2011
4
CA
Hi Peers,

i have a Drop down list with 10 choices (skillset).
users must choose one skillset an the corresponding level (beginer/intermediate/master). ( they have to this 10 times for all the sillsets)

what i want is when they chosoe the 1st skill, this one will not show up on the 2nd dropdown.

is it possible

any help ?

thanks guys
 
This is the Java[red]script[/red] forum a completely different thing to the Java programming language which can be found at: forum269.

If you are wanting to do this in Javascript, you can use the remove() function from the dropdown object.


Code:
var dropdownObject=document.getElementsById('idofdropdown');
dropdownObject.remove(x);

Where x is the number of the option you wish to remove. You can use the selectedIndex property for the other drop down to get the number of the option to be removed.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
hi Vacunita,
your suggestion works to remove the selected item from the list.
now how can i create a new drop downlist including only the remaining items or simply use the same one with the remaining itesm..
i need to add a button that allows me to create a new line with the new dropdown list..


Though ?


Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top