RSS Forums RSS
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting

javascript to add select button

Join Date: Jul 2005
Posts: 6
Reputation: goro is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
goro goro is offline Offline
Newbie Poster

Solution Re: javascript to add select button

  #3  
Jul 26th, 2005
Well, Alpha's link to msdn is the best resource for DHTML you'll find out there, finally MS made something that works great! . You can also buy a subscription to msdn (but i won't recomend you to do so... as it doesn't work as well as the online one)

Anyway...

Let's say your table has an id=TBL

To add a row, simply:

var oRow = TBL.insertRow();

You can set any property of the row by using the newly created object:
oRow.className = "cuteRow";
oRow.height = 20;
oRow.whatever = whatever.

Also, styles can be set directly to that row:
oRow.style.padding = 10;

Now, that would be an empty row.. without cells... you have two choices now... add as many cells as you need in a object oriented way:
oCell = oRow.insertCell()

or do a nasty but code saving job:
oRow.innerHTML = "<td><select>blablabla </td><td>blablabla... ";

Anyway, check the online msdn dhtml library for a complete reference of DHTML objects, behaviors, attributes, etc...
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 6:56 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC