I have a JavaScript function that works great when I call it through an \'onClick\' method. Basically what it does is pull data from a html form, and then based on that data, re
<form action="javascript:completeAndRedirect();">
<input type="text" id="Edit1"
style="width:280; height:50; font-family:'Lucida Sans Unicode', 'Lucida Grande', sans-serif; font-size:22px">
</form>
Changing action to point at your function would solve the problem, in a different way.
You need to prevent the default behaviour. You can either use e.preventDefault()
or return false;
In this case, the best thing is, you can use return false;
here:
<form onsubmit="completeAndRedirect(); return false;">
Looks like your form is submitting which is the default behaviour, you can stop it with this:
<form action="" method="post" onsubmit="completeAndRedirect();return false;">