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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove option value in a select object

Status
Not open for further replies.

dyboy1

Programmer
Jun 5, 2001
1
US
Is it possible to remove an option value from a current select object of a form using javascript?
 
check out faq216-335 for the whole code
selectboxname.options[index].remove() does the trick anyway
 
Removing does get rid of the option, but does it leave a blank space with no value attached in the select?

If the user selects that empty option, what value gets sent back?

M@
 
no, it removes the option from the list - totally (no blank space or anything)
 
Can I then assume that using .add() will put an option in? If so, do I need to give it an index, or will it just drop it in at the end?

Thanks for the feedback btw:)
M@
 
JavaRavyn, please go and read the faqs, try the examples, and then if ANYTHING remains unclear, i'll be glad to answer you here :)) - i'm saying so, because the add example is given and detailed in the faq ;]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top