 {assign var=x value=1}
{foreach $alldata as $myproductdata}
<input type="text" readonly name="serialnumber{$x}" value="{$myproductdata->serialnumber}" />
<input type="text" readonly name="productName{$x}" value="{$myproductdata->productName}" />
<input type="text" readonly name="price{$x}" value="{$myproductdata->productSellUnitPrice}" />
<input type="text" readonly name="don{$x}" value="{$myproductdata->don}" />
<br>
 {capture assign=x}{$x+1}{/capture} 
{/foreach}
<input name="serailcount" type="hidden" value="{$serailcount}">