faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

0 of 2 people (0%) answered Yes
Recently 0 of 2 people (0%) answered Yes

Entry

how to assign javascript variable to option value of combobox whichisdynamicallycreated injavascript

Apr 9th, 2008 20:27
ha mo, Dave Clark, swapna,


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Swapna,
     You can search through the form's elements collection to find all 
of the SELECT elements present.  This will give you a starting place:
var ele = document.forms['formName'].elements;
var x, len = ele.length;
for (x=0; x<len; ++x)
{
    if(ele[x].type == 'select-one'
    || ele[x].type == 'select-multiple')
    {
        // is this the one you want?
    }
}
Take care,
Dave Clark
www.DaveClarkConsulting.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://www.businessian.com
http://www.healthinhealth.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com