You have lots of issue to deal with. but one major thing I will point out
everytime you click on Add button it create another sets of objects with same name as beginning. so whenever you click add button for the first time it a it creates another sets of objects. then it becomes array of objects.
then you cant get the values with document.frm.count.value.
in incrementCount1 you have accessed objects with ID, but you didn't put any identification to any objects. fix these :)
an example for your help:
<SCRIPT>
RowCount=1;
stat=false;
function AddRow()
{
RowCount++; jQtable=$('#SaleTable');
jQtable.each(function()
{
var LastRow="<TR><TD align=center><INPUT TYPE='text' name='ProductName_"+RowCount+"'></TD><TD align=center><INPUT style='text-align:right' type='TEXT' name='Quantity_"+RowCount+"' ID='Quantity_"+RowCount+"' size=10></TD><TD align=center><INPUT style='text-align:right' type='TEXT' name='UnitPrice_"+RowCount+"' ID='UnitPrice_"+RowCount+"' size=10></TD><TD align=center><INPUT style='text-align:right' type='TEXT' name='TotalPrice_"+RowCount+"' ID='TotalPrice_"+RowCount+"' size=10></TD><TD align=center><textArea name='Remark_"+RowCount+"' ID='Remark_"+RowCount+"' cols=10></textArea></TD><TD align=center></TR>";
$(this).append(LastRow);
});
}
function removeTableRow()
{
jQtable=$('#SaleTable');
if(RowCount > 1)
{
jQtable.each(function()
{
if($('tbody', this).length > 0)
{
$('tbody tr:last', this).remove();
}
else
{
$('tr:last', this).remove();
}
});
RowCount--;
}
}
</SCRIPT>
<TABLE id='SaleTable'>
<TR style='color:WHITE;font-weight:900;background:#4876FF;font-size:10pt'>
<TD align=center>
Product Name
</TD>
<TD align=center>
Quantity
</TD>
<TD align=center>
Unit Price
</TD>
<TD align=center>
Total Price
</TD>
<TD align=center>
Remarks
</TD>
</TR>
<TR>
<TD align=center>
<INPUT TYPE="TEXT" ID="ProductName_1">
</TD>
<TD align=center>
<INPUT type='TEXT' name='Quantity_1' ID='Quantity_1' size=10 style='text-align:right'>
</TD>
<TD align=center>
<INPUT type='TEXT' name='UnitPrice_1' ID='UnitPrice_1' size=10 style='text-align:right'>
</TD>
<TD align=center>
<INPUT type='TEXT' name='TotalPrice_1' ID='TotalPrice_1' size=10 style='text-align:right'>
</TD>
<TD align=center>
<textArea name="Remark_1" ID="Remark_1" cols=10></textArea>
</TD>
</TR>
</TABLE>
<INPUT onclick='AddRow()'>
<INPUT onclick='removeTableRow()' type='button' value='s'> <!--This will work now-->
To test this code also import jquery