Hi Dave,
Yes, this is working fine.
Thank you very much !
One small issue is there, When ever I am adding new option. It is adding to the first parent row only(testingTable1) since it is hard coded as in the below code, how to change this dynamically like while I add option to a parent table, it should add only to that option table inside the parent table.
For example:
I am appending a new parent row with its option row id="testingTable2",
When I add new option row for testingTable2, it should append a row in testingTable2 and not in testingTable1 but it is not happening in my code.
And delete button for new row is also not working. Please do help me . Thanks
function addNewOption(){
$("#testingTable2").append("<tr align='center' style='background: #f2f2f2;'><td><input type='text' size='1' /></td><td><input type='text' size='1' /></td><td><input type='text' size='1' /></td><td><img class='delOptionRow' style='cursor: pointer;' src='../img/delete-icon.gif' /></td></tr>");
}
var new_id = 2;
function addNewRow(){
$("#NewCheckBox").append("<tr align='center' style='background: #f2f2f2;''><td rowspan='2'><input type='text' size='1' /></td><td rowspan='2'><input type='text' size='1' /></td><td rowspan='2'><input type='text' size='1' /></td><td colspan='4'>Options</td><td rowspan='2'><input type='button' value='add options' onclick='addNewOption()'></td></tr><tr align='center'><td><table id='testingTable" +new_id++ +"' border='1'><tr align='center' style='background: #f2f2f2;'><td><input type='text' size='1' /></td><td><input type='text' size='1' /></td><td><input type='text' size='1' /></td><td><img class='delOptionRow' style='cursor: pointer;' src='../img/delete-icon.gif' /></td></tr></table></td></tr>");
$('#testingTable2 td img.delOptionRow').click(function(){
$(this).parent().parent().remove();
});
}
The above is the code that I am using.
Thanks,
Suren