S
staeri
I'm using the following formula to sum values into a textbox. How can I
make it work even if the underlying textbox doesn't exist? It should
then be treated as 0.
document.getElementById('_ctl2_lblForecastYearSumRevenues').innerHTML =
CheckValue(document.getElementById('_ctl2_txtCurrentYearRevenues').value);
function CheckValue(amount) {
if(amount=="" || isNaN(amount))
return 0;
else
return parseInt(amount);
}
Regards,
S
make it work even if the underlying textbox doesn't exist? It should
then be treated as 0.
document.getElementById('_ctl2_lblForecastYearSumRevenues').innerHTML =
CheckValue(document.getElementById('_ctl2_txtCurrentYearRevenues').value);
function CheckValue(amount) {
if(amount=="" || isNaN(amount))
return 0;
else
return parseInt(amount);
}
Regards,
S