Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
03-11-2009, 09:11 PM #1
- Join Date
- Mar 2009
- Thanked 0 Times in 0 Posts
here is part of my code:
function Calc(Atext, Btext, form)
<form action="" name="Calculator" METHOD="post" onsubmit="return Calc(this.Amt.value, this.APR.value, this)" style="z-index: 1; width: 565px; height: 47px; position: absolute; top: 128px; left: 309px">
The form takes the values in the Amt and APR textboxes and automatically formats them. Once you click the "Calculate" button (a graphic image), the program calls the onsubmit to the Calc function, which then properly validates the text and processes it. The idea here was to convert the answer from a text answer (i.e., "$125.00") into pictures. I have the individual picture files linked. Everything works right...
Not long after the answer appears on the screen, the page reloads or refreshes or whatever. I've been pulling my hair out on this! I want the page to stay up once everything's complete, and make no changes at all until (unless) the user clicks another button. Can anyone help?
03-11-2009, 10:00 PM #2
Are you making sure that your Calc( ) function *ALWAYS* returns false??? If not, the submit of the <form> will go ahead and take place.
Maybe an easier way to make sure this doesn't happen is via:
Code:<form action="" name="Calculator" METHOD="post" onsubmit="Calc(this.Amt.value, this.APR.value, this); return false;" style="z-index: 1; width: 565px; height: 47px; position: absolute; top: 128px; left: 309px">