MySQL Forums
Forum List  »  Newbie

header function fails
Posted by: LaTicca Peeples
Date: August 19, 2005 12:22AM

i have a form that i want to be completed, validated, then directed to another file to process the database insert command. i had already created this form with a validation script that worked perfectly and was hoping to make "minor" adjustments to it. here's the script in part:

<HTML>
<head>
<script language="JavaScript" type="text/javascript">

function Validatemercy()
{
var method = document.mercy.ContactMethod;
var email = document.mercy.EmailAddress;
var address = document.mercy.PostalAddress;

if (method.selectedIndex < 1)
{
alert("Please provide your preferred method of contact.");
method.focus();
return false;
}
if ((method.selectedIndex==1) && (email.value == ""))
{
window.alert("Please enter your email address.");
email.focus();
return false;
}
return true;
}
// -->
</script>

</head>
<form name="mercy" method="post" action="http://..../mercy.html";
onSubmit="return Validatemercy();">
<input type="hidden" name="id" value="NULL">
<input type=submit name="sent" value="Submit Form" language="JavaScript" onclick="return validate(this)">
<INPUT TYPE=RESET VALUE="Reset Form">
</FORM>

i have no problem with the validation, but after the form is completed correctly and resubmitted, an error message (page cannot be displayed; HTTP 405 - Resource not allowed IIS) appears.

i tried to insert header("Location: validate.php"); in the return true of my if statement, but i keep getting "page cannot be displayed."

can anyone help me?

Options: ReplyQuote


Subject
Written By
Posted
header function fails
August 19, 2005 12:22AM
August 19, 2005 02:54AM
August 19, 2005 08:26AM
August 22, 2005 08:28AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.