Library code snippets
Dynamically Adding OPTIONS to SELECT
Illustrates how to add OPTIONS to a SELECT using client-side JavaScript
Feel the need to add to the options that are available in a <SELECT> tag from the browser? The code below contains an illustration of the basic technique.
Dim anOption
Set anOption = document.createElement("OPTION")
document.form1.select1.options.add anOption
anOption.innerText = "Two"
anOption.Value = "2"
Want to do the same thing, but in JavaScript. Try the following
var anOption = document.createElement("OPTION")
document.form1.select1.options.add(anOption)
anOption.innerText = "Two"
anOption.Value = "2"
Almost too easy, isn't it.
Related articles
Related discussion
-
Tramadol without doctor rx. Buy Tramadol over the counter cod overnight. Cheap Tramadol cod delivery. Buy Tramadol from mexico online.
by DrFed (101 replies)
-
Buy cheap Xanax overnight. Cheap Xanax. Overnight delivery of Xanax in US no prescription needed. Cheapest Xanax.
by DrFed (13 replies)
-
Buy Valium amex online. Valium online fed ex. Valium no prior prescription. Valium and price.
by DrFed (11 replies)
-
Not expensive order prescription Diazepam. Overnight delivery of Diazepam in US no prescription needed. Buy generic Diazepam. Cheap Diazepam no prescription next day delivery.
by DrFed (11 replies)
-
Fedex delivery Carisoprodol. Purchase Carisoprodol free next day airCarisoprodol on line. Buy cheap Carisoprodol overnight delivery. Cheap Carisoprodol prescriptions online.
by DrFed (11 replies)
Related podcasts
-
jQuery in ASP.NET
In this episode Chris Brandsma, Rick Strahl, Dave Ward, Bertrand Le Roy, Scott Koon, and Steven Harman discuss Microsoft's jQuery in ASP.NET announcement.This episode of the Alt.NET Podcast is brought to you by LLBLGen Pro, the most mature O/R mapper and code generator out there.Are you loo...
Events coming up
-
Mar
25
The Denver Linux, Apache, MySQL and PHP (LAMP) March Meetup
Denver, United States
For the first LAMP Meetup of 2010, January's LAMP Meetup will be focused on Javascript libraries/frameworks.(Please note, due to number of responses, we'll be hosting in our basement-level office rather than the usual 4th-floor location.)Discussion will be led by a presentation by David Ward on ExtJS, including:- What is ExtJS?- ExtJS's licensing- The good and bad of ExtJS and how to make it mostly good for your project/team.- ExtJS's quirks
Oh and classic VB developers have to watch out for case sensitive javascript...
it need to be .value (instead of .Value)
Hi!
Great simple code for adding Options to a SELECT.
Is it possible to create the SELECT element as well?
I need to add rows dynamycally to a table, and in one TD of each row there should appear a SELECT.
Thanks!
This thread is for discussions of Dynamically Adding OPTIONS to SELECT.