0

hi ...
javascript:

function calc() {
var qty=eval(document.getElementById('<%=txtnoofpack.ClientID %>').value);
var fre=eval(document.getElementById('<%=txtFregiht.ClientID %>').value);

var ha=eval(document.getElementById('<%=txthamai.ClientID %>').value);
var dd=eval(document.getElementById('<%=lblDDcharge.ClientID %>').value);

document.getElementById('<%=txtamt.ClientID %>').value = qty * fre + dd + ha;

var ser=eval(document.getElementById('<%=txtsertax.ClientID %>').value);
var am=eval(document.getElementById('<%=txtamt.ClientID %>').value);

if(am >= 750 )
{
document.getElementById('<%=txttot.ClientID %>').value = ser * am + am ;
}
else
{
document.getElementById('<%=txttot.ClientID %>').value = am ;
}
}

C#

this line error Input string was not in a correct format coming

objclsGCFormInsert.Total_amount = Convert.ToDecimal(txttot.Text);

in database total decimal(12,2) type declared

plz solve the problem..

Edited by __avd: Added [code] tags. Encase your code in: [code] and [/code] tags.

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by psathish2
0

>Input string was not in a correct format.

decimal val;
decimal.TryParse(txttot.Text, out val);
objclsGCFormInsert.Total_amount = val;
0

thank adatapost.. error not coming now.. thank u verymuch

if but when i am going to click the insert button total column 0 inserted..
if i click the insert button txttot.Text value not displayed..

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.