• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

How to add and remove options in dropdown menu?

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<select name="test">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
I want to remove the last option,and add "new" option into the <select> using javascript.Can any one help?
Thanks in advance...
 
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Mellihoney Michael:
<select name="test">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
I want to remove the last option,and add "new" option into the <select> using javascript.Can any one help?
Thanks in advance...


What interface you are going to use to perform add/remove action?
Is it button click? from other list box?
Anyway,check this link..might be of your need.
http://www.mattkruse.com/javascript/selectbox/
 
Mellihoney Michael
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
add one options from one dropdown menu to another,and remove the option in the previous menu,can you help me...
Thanks in advance
 
himanshu patel
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Mellihoney Michael:
add one options from one dropdown menu to another,and remove the option in the previous menu,can you help me...
Thanks in advance


Did you check link given in my previous post?
Is it not what you want? You may need to modify a little bit.
 
Humans and their filthy friendship brings nothing but trouble. My only solace is this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic