ms_dos10 Posted September 17, 2006 Share Posted September 17, 2006 that my code can i add two number and get the result on the same page on text field . it'll work with sumbit button onsubmit or normal button onclick i don't know pllllllllzzzzzzzzzz help i know it normal question but what shall i do i try everything but not work anyone help me [/code]<html><head> <title></title><script type="text/javascript"> function add(a, { var a = document.frm.num1.value var b = document.frm.num2.value var result return result=parseint(a)+parseint( result = document.frm.result.value }</script></head><body><center><form name="frm" action="" method="post" onsubmit="return add()"><h5>Num One</h5><input type="text" name="num1" value=""><br> <h5>Num Two</h5><input type="text" name="num2" value=""><br><h5>Result</h5><input type="text" name="result" value=""><br><input type="submit" name="butt" value="Click Me To Add Two Number"></form></center></body><html> [code]<html><head> <title></title><script type="text/javascript"> function add(a,b) { var a = document.frm.num1.value var b = document.frm.num2.value var result return result=parseint(a)+parseint(b) result = document.frm.result.value }</script></head><body><center><form name="frm" action="" method="post" onsubmit="return add()"><h5>Num One</h5><input type="text" name="num1" value=""><br> <h5>Num Two</h5><input type="text" name="num2" value=""><br><h5>Result</h5><input type="text" name="result" value=""><br><input type="submit" name="butt" value="Click Me To Add Two Number"></form></center></body><html> Link to comment Share on other sites More sharing options...
skym Posted September 18, 2006 Share Posted September 18, 2006 result=document.frm.result.value => document.frm.result.value=result Link to comment Share on other sites More sharing options...
ms_dos10 Posted September 19, 2006 Author Share Posted September 19, 2006 its not working with me i don't why i someone have fill example post it for me here no one can help i need help plzzzzzzzzzzzzzz 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