I have a form, accesible via the web, that contains a number of editable fields and a NEXT button.
When the NEXT button is clicked I want to save the document and, if the user wishes to enter another set of data return them to the previous form with the fields cleared. Otherwise, the user should just continue to the next step:
var form = document.forms[0];
if (confirm(“Add another contact?”)){
form.submit();
}
else{
alert (‘Goto Next Step’);
}
I also have a $$Return field containing the following:
“”+@Char(13)+
“”+@Char(13)+
“<meta http-equiv="refresh" content="2;URL=javascript:resetFields();">”+@Char(13)+
“”+@Char(13)+
“<body bgcolor="#FFFFFF">”+@Char(13)+
“<div align="center"><font face="Arial, Helvetica, sans-serif" size="2" color="#31458C">One moment please… ”+@Char(13)+
“”+@Char(13)+
“”
On the JSHeader I have created a resetFields function:
function resetFields() {
window.history.go(-1);
form.ContactName.value=“”;
form.ContactTitle.value=“”;
form.ContactTelephone.value=“”;
form.ContactCell.value=“”;
form.ContactEmail.value=“”;
}
When the user enters the data and clicks the NEXT button, if they answer OK to the prompt, the message ‘One moment please…’ displays while the document is being saved, but I am not returning to the form (the form is displayed in the right portion of a two frame frameset). Instead I am returning to the last url - like I clicked the back button.
Am I trying to do the impossible? Any ideas or suggestions would be greatly appreciated. Thanks in advance.