Gautam Buddha Temple Varanasi,Varanasi - Buddhist Pilgrimage

Sunday, January 17, 2010

Calculate two textbox value using javascript

Calculate two textbox value using javascript in ASP.NET
function Calculate()
{
var txtProposalValue = document.getElementById('<%=txtProposalValue.ClientID %>');
var txtProfit = document.getElementById('<%=txtProfit.ClientID %>');
var txtLikelyValue = document.getElementById('<%=txtLikelyValue.ClientID %>');
var LikelyValue =(parseFloat(txtProposalValue.value) + parseFloat(txtProfit.value));
if(txtProfit.value =="")
{
txtLikelyValue.value = "0";
}
else
{
txtLikelyValue.value = LikelyValue;
}
}

No comments:

Post a Comment