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

3 Answers 3

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

Sign up to request clarification or add additional context in comments.

Comments

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/

2 Comments

I have to append the following row on clicking a link.How do i do it ?? <table id="tblJob"><tr id="trjob"><td>Job Position</td><td><input type="text"id="txtName"/></td><td><input type="file" id="fupBrowse"title="Browse"/></td></tr></table>
Something like this in your onclick event: $("#YourTable tr:last").append('<tr><table id="tblJob"><tr id="trjob"><td>Job Position</td><td><input type="text"id="txtName"/></td><td><input type="file" id="fupBrowse"title="Browse"/></td></tr></table></tr>'); The link posted by TJB should probably help you as well
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.