Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
141162 | Nov 27,2018 03:59 PM UTC | Nov 29,2018 06:03 AM UTC | ASP.NET Web Forms | 3 |
![]() |
Tags: CurrencyTextbox |
$("#SubA").ejCurrencyTextbox({
decimalPlaces: 2,
showSpinButton: false,
watermarkText: "$0.00",
//Bind the focusOut event for CurrencyTextBox
focusOut: "calculateTotal"
});
$("#SubB").ejCurrencyTextbox({
decimalPlaces: 2,
showSpinButton: false,
watermarkText: "$0.00",
//Bind the focusOut event for CurrencyTextBox
focusOut: "calculateTotal"
});
$("#Total").ejCurrencyTextbox({
decimalPlaces: 2,
showSpinButton: false,
watermarkText: "$0.00"
});
//LostFocus event for both SubA and sub B currency textbox
function calculateTotal() {
// Instance for SubA CurrencyTextBox, it’s used to access the value to that textbox
var subAObj = $("#SubA").ejCurrencyTextbox("instance");
// Instance for SubB CurrencyTextBox, it’s used to access the value to that textbox
var subBObj = $("#SubB").ejCurrencyTextbox("instance");
// Instance for Total CurrencyTextBox, it’s used to access the value to that textbox
var totalObj = $("#Total").ejCurrencyTextbox("instance");
//Using instance to get the values and add it
var total = subBObj.model.value + subAObj.model.value;
//Update the total values to Total currency textbox
totalObj.option("value", total);
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.