Forum Moderators: open
The problem i have it that if the user clicks the back button on the browser from the confirmation page the form is submitted again.
Does anyone know of a way of preventing this from happening? Can I stop this page from being added to the history?
Any help is gratefully appreciated.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title> Clients</title>
<link rel="stylesheet" type="text/css" href="../../css/style.css">
</head>
<body onLoad="document.formname.submit();">
<form NAME="formname" method="POST" action="/cgi-bin/cgiemail/jobsapply.txt">
<input type="hidden" name="Data" value="[Data]">
<input type="hidden" name="Instructions" value="[Instructions]">
<input type="hidden" name="success" value="/candidates/jobs/apply_success.shtml">
<INPUT TYPE="hidden" name="JOBTITLE">
<INPUT TYPE="hidden" name="JOBCODE">
<INPUT TYPE="hidden" name="username">
</FORM>
<SCRIPT LANGUAGE="JavaScript"><!--
function replace(string,text,by) {
// Replaces text with by in string
var i = string.indexOf(text), newstr = '';
if ((!i) ¦¦ (i == -1))
return string;
newstr += string.substring(0,i) + by;
if (i+text.length < string.length)
newstr += replace(string.substring(i+text.length,string.length),text,by);
return newstr;
}
var passed = replace(replace(location.search.substring(1),"+"," "),"=","&");
function split(string,text) {
var strLength = string.length, txtLength = text.length;
if ((strLength == 0) ¦¦ (txtLength == 0)) return;
var i = string.indexOf(text);
if ((!i) && (text != string.substring(0,txtLength))) return;
if (i == -1) {
splitArray[splitIndex++] = string;
return;
}
splitArray[splitIndex++] = string.substring(0,i);
if (i+txtLength < strLength)
split(string.substring(i+txtLength,strLength),text);
return;
}
//--></SCRIPT>
<SCRIPT LANGUAGE="JavaScript1.1"><!--
function split(string,text) {
splitArray = string.split(text);
splitIndex = splitArray.length;
}
//--></SCRIPT>
<SCRIPT LANGUAGE="JavaScript"><!--
var splitIndex = 0, splitArray = new Object();
split(passed,'&');
for (var i=0; i < splitIndex; i=i+2) {
if (splitArray[i] == 'JOBCODE')
document.formname.JOBCODE.value = unescape(splitArray[i+1]);
if (splitArray[i] == 'JOBTITLE')
document.formname.JOBTITLE.value = unescape(splitArray[i+1]);
if (splitArray[i] == 'username')
document.formname.username.value = unescape(splitArray[i+1]);
}
//--></SCRIPT>
>
<p align="center"><b><font color="#FFFFFF" size="4">Processing.....</font></b></p>
</body>
</html>