Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] help


  • From: walter at torres.ws (Walter Torres)
  • Subject: [Javascript] help
  • Date: Wed Apr 16 14:08:47 2003

This looks like your trying to add an Item to a Pick List (SELECT).

Use this... (see below)

walter

// Add a single Item to a Select Option List
function addOption ( strList, strItemText, strItemValue )
{
   // Which list
   var objList = document.getElementById( strList );

   // Do we have a list to deal with?
   if ( ! objList )
      return false

   // Add New Item Selected item
   objList.options[objList.options.length] = new Option( strItemText,
strItemValue );

   // It worked!
   return true
}




> -----Original Message-----
> From: javascript-admin@xxxxxxxxxx [mailto:javascript-admin@xxxxxxxxxx]On
> Behalf Of Alex Benitez
> Sent: Monday, February 03, 2003 9:18 AM
> To: javascript@xxxxxxxxxx
> Subject: [Javascript] help
>
>
>
>
> example:  <select id='parentSelect'></select>
>
> then later i call parentSelect.innerHTML = "<option>opval</option>"
>
> what actually ends up in that property is "opval</option>"
> _______________________________________________
> Javascript mailing list
> Javascript@xxxxxxxxxx
> https://lists.LaTech.edu/mailman/listinfo/javascript