Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaScript Add a Row

 
bofeibous smith
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How would I script the following to allow me to dynamically add a row vs a static value so the end user can click on a plus icon to add a row vs showing them all. The following is set statically for 8 rows. This is only for one (host) section. There are about 10.


 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please UseCodeTags when posting code. It will increase the chances of you getting help.
 
bofeibous smith
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My apologies .... updated.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And this is why I detest PHP.

In any case: which JavaScript library are you using?
 
bofeibous smith
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any, just trying to find a easy solution.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:In any case: which JavaScript library are you using?
 
bofeibous smith
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MooTools, jQuery
 
Paul Clapham
Sheriff
Posts: 21298
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think if the question is how to write Javascript to modify some HTML, it would be a good idea if we saw the HTML in question. Seeing some code which generates that HTML isn't nearly as useful.
 
bofeibous smith
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HTML Output

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lol, with a touch of irritation: why make it difficult for people to help you?

Anyway:

$('#myTable > tbody:last').append('<tr>...</tr>');
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic