Adding options to a select element 
Author Message
 Adding options to a select element

Does anybody know how I can dynamically add items to a select box without
refreshing the page.
Example: I have a text box with a button, user types in word into text box
and clicks button. An item is then added to the select box on that page.

CODE:
onclick event -

function addToList(strLocation)
 {
  if (strLocation != "" && strLocation != null)
  {
   add item to selet box
  }
 }



Sat, 05 Jul 2003 00:32:14 GMT  
 Adding options to a select element
yourSelect[yourSelect.length] = new Option(strLocation);

=-=-=
Steve
-=-=-


Quote:
> Does anybody know how I can dynamically add items to a select box without
> refreshing the page.
> Example: I have a text box with a button, user types in word into text box
> and clicks button. An item is then added to the select box on that page.

> CODE:
> onclick event -

> function addToList(strLocation)
>  {
>   if (strLocation != "" && strLocation != null)
>   {
>    add item to selet box
>   }
>  }



Sat, 05 Jul 2003 01:12:40 GMT  
 Adding options to a select element
Thanks steve! My last name is Fulton too. WE RULE

Quote:
> yourSelect[yourSelect.length] = new Option(strLocation);

> =-=-=
> Steve
> -=-=-



> > Does anybody know how I can dynamically add items to a select box
without
> > refreshing the page.
> > Example: I have a text box with a button, user types in word into text
box
> > and clicks button. An item is then added to the select box on that page.

> > CODE:
> > onclick event -

> > function addToList(strLocation)
> >  {
> >   if (strLocation != "" && strLocation != null)
> >   {
> >    add item to selet box
> >   }
> >  }



Sat, 05 Jul 2003 22:02:26 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. how to add OPTION element in SELECT at runtime using Client side vbscripting

2. Adding OPTION Element to SELECT

3. Dynamic adding options to <select> element

4. How to dynamically select option in select element?

5. changing select options based on previously selected options

6. ?Selecting/Indexing Options elements by Name value

7. Select element doesn't show first option?

8. Background-color for SELECT / OPTION elements

9. ?Selecting/Indexing Options elements by Name value

10. ?Selecting/Indexing Options elements by Name value

11. CDO using select element options Help!!!!!!!!!

12. Saving a select element's options collection for later

 

 
Powered by phpBB® Forum Software