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?

2 of 5 people (40%) answered Yes
Recently 2 of 5 people (40%) answered Yes

Entry

how to get the value of a javascript control created dynamically in .net

Apr 8th, 2008 19:19
ha mo, Dave Clark, Liyakath ameer,


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Liyakath,
     Even though created dynamically, the ASP.NET code should give the 
object a unique ID attribute value.  Then you just use the 
document.getElementById() method to obtain addressability to that 
object in JavaScript.  Otherwise, you have to create a custom 
collection and loop through that collection to find the object in 
which you're interested.  For example:
var grp = document.getElementsByTagName("TABLE");
var x, len = grp.length;
for (x=0; x<len; ++x)
{
    // check grp[x] -- is this the table object you want?
}
Take care,
Dave Clark
www.DaveClarkConsulting.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://www.businessian.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
http://www.healthinhealth.com