|
function servLookup1() {
var scharge = JSON.parse('<%=SchargeJSON%>');
var needle = document.getElementById("servcode1").value;
needle = needle.trim();
var i;
for (i = 0; i < scharge.rows.length; i++){
if (scharge.rows[i].servcode == needle){
break;
}
}
document.getElementById("servprice1").value = scharge.rows[i].servprice;
var x1 = document.getElementById("servqty1").value;
var y1 = document.getElementById("servprice1").value;
var z1 = parseInt(x1) * parseInt(y1);
document.getElementById("servamt1").value = z1;
var a1 = z1;
var a2 = document.getElementById("servamt2").value;
var a3 = document.getElementById("servamt3").value;
var a4 = document.getElementById("servamt4").value;
var a5 = document.getElementById("servamt5").value;
var aTot = parseInt(a1) + parseInt(a2) + parseInt(a3) + parseInt(a4) + parseInt(a5);
document.getElementById("demandamt").value = aTot;
}
|
<% SELECT * FROM SON5200 INTO CURSOR crScharge ORDER BY Servcode IF _TALLY > 0 SchargeJSON = fwJSON.WriteCursor() ENDIF %>
<script type="text/javascript> var scharge = JSON.parse('<%=SchargeJSON%>'); ...JS code that uses the data in the scharge variable </script> |
FoxWeb Support Team support@foxweb.com email |