hi ...

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 ;
document.getElementById('<%=txttot.ClientID %>').value = am ;


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..

Recommended Answers

All 2 Replies

>Input string was not in a correct format.

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

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..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.