script.js
728 Bytes
function AddRow(_this, Pid)
{
Row = $("#"+Pid +" tr");
IndexLast = $("#"+Pid +" tr:last").index();
$(Row[IndexLast-1]).after("\
<tr id=\""+Pid+"_"+IndexLast+"\">\
<td></td>\
<td><input class=\"text-size03\" type=\"text\" name=\""+Pid+"[n"+IndexLast+"][]\"></td>\
<td><input class=\"text-size04\" type=\"text\" name=\""+Pid+"[n"+IndexLast+"][]\"></td>\
<td><input class=\"text-size05\" type=\"text\" name=\""+Pid+"[n"+IndexLast+"][]\"></td>\
<td><a class=\"btn-delete\" href=\"#\" onclick=\"DeliteRow(this,'"+Pid+"_"+IndexLast+"'); return false;\">Удалить</a></td>\
</tr>");
}
function DeliteRow(_this, Pid)
{
$("#"+Pid+" input").attr("value","");
$("#"+Pid).css("display","none");
}