K
kelvin
Hi,
I'm having this problem and I can't seem to solve it.
I've created a confirmation page. The page displays the form field
data and has
2 links - OK (to continue) and Cancel (go back to form).
The OK button will continue to validate the form values, cancel to
close window.
The problem starts here. I get script error and the error message
doesn't tell me
what's the problem.
Also how do I include the form action code?
Can someone help me, pls? Your help/guidance is much appreciated!
Rgds,
Kelvin
<SCRIPT LANGUAGE="JavaScript">
<!--
function display()
{
var x;
DispWin = window.open('','ConfirmPage',
'toolbar=no,status=no,width=300,height=200')
message = "<ul><li><b>destination: </b>" +
document.form1.destination.value;
message += "<li><b>Weight: </b>" + document.form1.Weight.value;
message += "<li><b>departure: </b>" + document.form1.departure.value
+ "<br>";
message += "\nChoose OK to submit these values, or\n"
message += "Cancel to return to the form. <br><br>";
message += "<a href='javascriptnclick='opener.document.form1.checkForm1();self.close();''>OK</a>
"; //ERROR ON THIS LINE.
DispWin.document.write(message);
}
function checkForm1()
{
if(document.form1.destination.value == "")
{
alert("Destination must not contain numbers at all.");
document.form1.destination.focus();
return false;
}
if(document.form1.departure.value == "")
{
alert("Origin must not contain numbers at all.");
document.form1.departure.focus();
return false;
}
if(document.form1.station.value == "")
{
alert("Please provide the station.");
document.form1.station.focus();
return false;
}
}
// End -->
</script>
<form method="post" name="form1">
<input name="destination" type="text" value="US">
<input name="Weight" type="text" value="456">
<input name="departure" type="text" value="UK">
<input name="submit" type="submit" value="Quote" onClick="display();">
</form>
I'm having this problem and I can't seem to solve it.
I've created a confirmation page. The page displays the form field
data and has
2 links - OK (to continue) and Cancel (go back to form).
The OK button will continue to validate the form values, cancel to
close window.
The problem starts here. I get script error and the error message
doesn't tell me
what's the problem.
Also how do I include the form action code?
Can someone help me, pls? Your help/guidance is much appreciated!
Rgds,
Kelvin
<SCRIPT LANGUAGE="JavaScript">
<!--
function display()
{
var x;
DispWin = window.open('','ConfirmPage',
'toolbar=no,status=no,width=300,height=200')
message = "<ul><li><b>destination: </b>" +
document.form1.destination.value;
message += "<li><b>Weight: </b>" + document.form1.Weight.value;
message += "<li><b>departure: </b>" + document.form1.departure.value
+ "<br>";
message += "\nChoose OK to submit these values, or\n"
message += "Cancel to return to the form. <br><br>";
message += "<a href='javascriptnclick='opener.document.form1.checkForm1();self.close();''>OK</a>
"; //ERROR ON THIS LINE.
DispWin.document.write(message);
}
function checkForm1()
{
if(document.form1.destination.value == "")
{
alert("Destination must not contain numbers at all.");
document.form1.destination.focus();
return false;
}
if(document.form1.departure.value == "")
{
alert("Origin must not contain numbers at all.");
document.form1.departure.focus();
return false;
}
if(document.form1.station.value == "")
{
alert("Please provide the station.");
document.form1.station.focus();
return false;
}
}
// End -->
</script>
<form method="post" name="form1">
<input name="destination" type="text" value="US">
<input name="Weight" type="text" value="456">
<input name="departure" type="text" value="UK">
<input name="submit" type="submit" value="Quote" onClick="display();">
</form>