$(document).ready(function () {
$("#ddlPackName").change(function () {
// Your requirment
sum();
});
});
function sum() {
debugger;
// var final;
var amountToPay = document.getElementById('<%=lblPrice.ClientID%>').value /*Here throwing Microsoft JScript runtime error: Object required*/
var noOfConn = document.getElementById('<%=txtNoOfConn.ClientID%>').value;
var chargePerConn = document.getElementById('<%=txtChargePerConn.ClientID%>').value;
var installCharge = document.getElementById('<%=txtInstallCharge.ClientID%>').value;
var discount = document.getElementById('<%=txtDiscount.ClientID%>').value;
var packPrice;
if (isNaN(amountToPay)) {
amountToPay = 0;
}
if (isNaN(noOfConn)) {
noOfConn = 0;
}
if (isNaN(chargePerConn)) {
chargePerConn = 0;
}
if (isNaN(installCharge)) {
installCharge = 0;
}
if (isNaN(discount)) {
discount = 0;
}
if (document.getElementById('<%=ddlConType.ClientID%>').selectedIndex == "1") {
if (document.getElementById('<%=ddlPackName.ClientID%>').selectedIndex != "0") {
packPrice = amountToPay;
packPrice = amountToPay + (noOfConn * chargePerConn);
packPrice = packPrice + installCharge;
packPrice = packPrice - discount;
if (!isNaN(packPrice)) {
document.getElementById('<%=txtAmntToPay.ClientID%>').value = packPrice;
}
}
else if (document.getElementById('<%=ddlPackName.ClientID%>').selectedIndex == "0") {
packPrice = noOfConn * chargePerConn;
packPrice = packPrice + installCharge;
packPrice = packPrice - discount;
if (!isNaN(packPrice)) {
document.getElementById('<%=txtAmntToPay.ClientID%>').value = packPrice;
}
}
}
}
--%>
SELECT Post Paid Pre Paid
Select
0
0
0
onKeypress="sum();">0
0
/*Microsoft JScript runtime error: Object required*/
TabIndex="11" onselectedindexchanged="ddlPackName_SelectedIndexChanged">
/*Microsoft JScript runtime error: Object required*/

Replies
Know the answer? Post it — somebody with the same question will find it here.