Hello, I have a detailed form that has alot of javascript in it. The below section is required for it to run but when I have it in the page I have to hit the “Edit” button twice before it routes back to the previous page. Right now all it does is reload the same page its on. Everytime it takes 2 times hitting the button before It works correctly. If I take out the code then of course my javascript doesn’t work but my page redirects back fine.
Does anyone see what could be causing this?
Code in question———————-
<script language=”javascript”>
function reset_onclick(x){document.formc.reset();postcode();recalc_onclick(”);};function postcode(){};function
eequerystring(){var
querystring=document.location.search;if(querystring.length>0){variables=(querystring.substring(1)).split(“&”);var
variable;var key;var value;for(var
ii=0;ii<variables.length;ii++){variable=variables[ii].split(“=”);key=unescape(variable[0]);value=unescape(variable[1]);if(doc
ument.formc[key]!=null){document.formc[key].value=value;}}}}function
initial_update(){postcode(”);eequerystring();recalc_onclick(”);}
</script>
End——————————
<input type=submit value=” Edit ” onclick=”history.back()”>
<input type=button value=” Cancel ” onclick=”history.back()”>
<input type=hidden name=action value=”save”>
<input type=hidden name=page value=[[#_page]]>
<input type=hidden name=search value=[[#
<input type=hidden name=record value=[[#_record]]>
</form>