Lakshmi Posted November 15, 2006 Share Posted November 15, 2006 Hi I 'm gettimg small error.pls look into this a1=document.newp.amt.value; a2=(document.newp.otheramt.value);total=(a1+a2);i'm trying to addina1 ,a2 but thy r concatinating.how to add variablespls help me.. Link to comment Share on other sites More sharing options...
Webworldx Posted November 15, 2006 Share Posted November 15, 2006 Are they both numbers?a1=Math.floor(document.newp.amt.value);a2=Math.floor(document.newp.otheramt.value);total=(a1+a2); Link to comment Share on other sites More sharing options...
Lakshmi Posted November 16, 2006 Author Share Posted November 16, 2006 Are they both numbers?a1=Math.floor(document.newp.amt.value);a2=Math.floor(document.newp.otheramt.value);total=(a1+a2);Yes Both are numbers.its working fine.Thanks a lot. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now