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="JavaS cript">
<!--
function display()
{
var x;
DispWin = window.open('', 'ConfirmPage',
'toolbar=no,sta tus=no,width=30 0,height=200')
message = "<ul><li><b>des tination: </b>" +
document.form1. destination.val ue;
message += "<li><b>Wei ght: </b>" + document.form1. Weight.value;
message += "<li><b>departu re: </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='javascrip t:onclick='open er.document.for m1.checkForm1() ;self.close();' '>OK</a>
"; //ERROR ON THIS LINE.
DispWin.documen t.write(message );
}
function checkForm1()
{
if(document.for m1.destination. value == "")
{
alert("Destinat ion must not contain numbers at all.");
document.form1. destination.foc us();
return false;
}
if(document.for m1.departure.va lue == "")
{
alert("Origin must not contain numbers at all.");
document.form1. departure.focus ();
return false;
}
if(document.for m1.station.valu e == "")
{
alert("Please provide the station.");
document.form1. station.focus() ;
return false;
}
}
// End -->
</script>
<form method="post" name="form1">
<input name="destinati on" 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="displa y();">
</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="JavaS cript">
<!--
function display()
{
var x;
DispWin = window.open('', 'ConfirmPage',
'toolbar=no,sta tus=no,width=30 0,height=200')
message = "<ul><li><b>des tination: </b>" +
document.form1. destination.val ue;
message += "<li><b>Wei ght: </b>" + document.form1. Weight.value;
message += "<li><b>departu re: </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='javascrip t:onclick='open er.document.for m1.checkForm1() ;self.close();' '>OK</a>
"; //ERROR ON THIS LINE.
DispWin.documen t.write(message );
}
function checkForm1()
{
if(document.for m1.destination. value == "")
{
alert("Destinat ion must not contain numbers at all.");
document.form1. destination.foc us();
return false;
}
if(document.for m1.departure.va lue == "")
{
alert("Origin must not contain numbers at all.");
document.form1. departure.focus ();
return false;
}
if(document.for m1.station.valu e == "")
{
alert("Please provide the station.");
document.form1. station.focus() ;
return false;
}
}
// End -->
</script>
<form method="post" name="form1">
<input name="destinati on" 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="displa y();">
</form>
Comment