File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DOM and adding a brand new select list

 
Rob Hunter
Ranch Hand
Posts: 832
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone tell me or show me how I can dynamically add a new row to a table and in one of the newly added cells add a brand new select list? The cells I'm adding using DOM are fine but when I try putting in the select list it doesn't work. For example, if I try and set the cell's innerText it just displays the tag for the select list. If I try and set the innerHtml it gives me nothing. Any help would be appreciated. Thanks.

Rob
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64173
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where's your code?
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
with a select you should be use new Option()



Eric
 
binayakumar patel
Greenhorn
Posts: 27
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This may Help you.
 
binayakumar patel
Greenhorn
Posts: 27
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Inplace of

# var option1 = document.createElement("OPTION")
# option1.text="Banana"
# option1.value=1
# selectBox.options.add(option1)

We can use:

selectBox.options[selectBox.options.length]=new Option("Banana","1")
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic