I have this extract from an ASP code which I am trying to adapt for another purpose.
I wish to know what the code in following lines doing in the function chkfunc
stkObj = chk.id.substr(6);
stkObj = 'txtqnt' + stkObj;
The calling ASP ....
<td><input type=checkbox id='chkqnt<%=i%>' name='chkqnt<%=i%>' onclick=chkfunc(this,<%=i%>)></td>
<td><input type=text size=5 id='txtqnt<%=i%>' name='txtqnt<%=i%>' onblur=qntorder(this,<%=i%>) disabled ></td>
The called javascript ...
<script>
var itemstr="";
var qtystr="";
function chkfunc(chk,s)
{
var stkObj;
stkObj = chk.id.substr(6);
stkObj = 'txtqnt' + stkObj;
if (!chk.checked){
document.queryfrm.item(stkObj).value='';
document.queryfrm.item(stkObj).disabled=true
}else{
document.queryfrm.item(stkObj).disabled=false
}
if(chk.checked)
itemstr=itemstr + "'" + s + "'"
else{
itemstr = itemstr.replace("'"+s+"'","")
}
}
</script>