0

I have html table with 1 row to fill in job details for a position.Now If a user wants to fill in job details for another position,on clicking a link, a new row should be created dynamically each time the user clicks the link.Can any one please help me with the code in html

I'm using frontpage.

Thanks, Vix

vix
  • 1
  • 1

3 Answers3

2

I would suggest looking into jQuery, the most powerful javascript framework. It is popular and you can find lots of references, resources, plugins, code etc. to help you do lots of this stuff.

Here is a stackoverflow question covering adding a table row to a table using jQuery. Add table row in jQuery

Community
  • 1
  • 1
TJB
  • 13,367
  • 4
  • 34
  • 46
1

in simple Dom-Javascript without any frameworks you could use something like this

var tr  = document.createElement('tr');

var td1 = document.createElement('td');
var someDivToAppend = document.createElement('div');
someDivToAppend.innerHTML = "Some basic text content";

td1.appendChild(someDivToAppend);
tr.appendChild(td1);
...

But I guess that's probably too much handy work, a library like jQuery could help you there. You could look at: http://api.jquery.com/append/

tDo
  • 528
  • 3
  • 5
  • I have to append the following row on clicking a link.How do i do it ??
    Job Position
    – vix Feb 01 '10 at 04:18
  • Something like this in your onclick event: $("#YourTable tr:last").append('
    Job Position
    '); The link posted by TJB should probably help you as well
    – tDo Feb 01 '10 at 12:52
0

Also look at the YUI Datatable. Very full featured, and well documented.

Larry K
  • 47,808
  • 15
  • 87
  • 140