Tuesday, January 28, 2014

calculate mathematical operation in javascript by html id


You can easily calculate any mathematical expression in JavaScript using the senerio.



  // get element by id value for calculation  
     var NoOfDays = parseFloat(NoOfDays);  
     var MnyGrossSalary = parseFloat(MnyGrossSalary);  
     var ServiceBenefitDay = parseFloat(ServiceBenefitDay);  
     var EarnLeaveDepositedToCompany = parseFloat(EarnLeaveDepositedToCompany);  
     // Calculate your mathematical Expression  
     var totalBenefitDayAmount = ServiceBenefitDay * (MnyGrossSalary / NoOfDays);  
     var totalEarnLeaveAmount = EarnLeaveDepositedToCompany * (MnyGrossSalary / NoOfDays);  
     // Set value of your mathematical expression in your desire html control by id  
     document.getElementById('ServiceBenifitPayment_TotalBenefitDayAmount').value = parseFloat(totalBenefitDayAmount, 10).toFixed(2);  
     document.getElementById('ServiceBenifitPayment_TotalEarnLeaveAmount').value = parseFloat(totalEarnLeaveAmount, 10).toFixed(2);  


C# print file on LAN Printer

If you want to print any file on network printer then you can try with this code block // Change Default Printer System.Ma...