dave at cherryville.org
Wed Feb 9 08:13:38 PST 2005
Doug Boyd wrote:
> Upon completion of the function, the windows resets.
> I put the alert in to see what is happening.
first, change the submit button into a regular button, and second, move the onsubmit event handler
to the onclick event handler of the button. for example:
Enter total number of disks
<input type="text" name="totaldisks" size="10">
<input type="button" value="Solve"
<br /><br /><br />
<textarea name="box" id="box" cols="30" rows="10">Solution presented here.
by using a submit button the browser was submitting the form back to the page itself, which results
in a reset of the page as though you had hit the refresh button.
one thing trick/tip that I'll mention that has nothing to do with your question is the call to solve
uses document.myoutput.totaldisk.value, but you could also use this.form.totaldisk.value, where
"this" refers to the button being clicked, and "this.form" refers to the form of the button being
clicked. I like to use this.form because it's a more encapsulated.
More information about the clug-progsig