Click to See Complete Forum and Search --> : FrontPage Form Submit Valid Email Address


dougabc123
03-14-2006, 02:59 PM
Firstly, here is a link to the web page:

http://www.dialahead.com/2006/example.htm

The error that I'm receiving is below:

Method Not Allowed
The requested method POST is not allowed for the URL /2006/example.htm.

Apache/1.3.34 Server at dialahead.com Port 80

I'm using MS FrontPage 2003.

Here is what I'm trying to accomplish:

1. Have web site visitors submit a form that includes contact information and their valid email address.
2. Have the form validate that 'a valid email address was entered', in correct email syntax, and not blank on the form.
3. Have an email sent to the email address that was entered on the form. This email doesn't necessarily need to require any validation actions (just simply provides the information that the form promised to supply upon submission).
4. Display's a form submission confirmation web page (another web page).

The script that I've found (see source below) that validates the 'entry' of a valid email address, seems to work well to validate email address syntax, but I'm receiving the error above.

Additionally I need to know how to accomlish the missing steps 3 & 4 above.

Here's the code:

START

<script language = "Javascript">
/**
* DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
*/

function echeck(str) {

var at="@"
var dot="."
var lat=str.indexOf(at)
var lstr=str.length
var ldot=str.indexOf(dot)
if (str.indexOf(at)==-1){
alert("Invalid E-mail ID")
return false
}

if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
alert("Invalid E-mail ID")
return false
}

if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
alert("Invalid E-mail ID")
return false
}

if (str.indexOf(at,(lat+1))!=-1){
alert("Invalid E-mail ID")
return false
}

if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
alert("Invalid E-mail ID")
return false
}

if (str.indexOf(dot,(lat+2))==-1){
alert("Invalid E-mail ID")
return false
}

if (str.indexOf(" ")!=-1){
alert("Invalid E-mail ID")
return false
}

return true
}

function ValidateForm(){
var emailID=document.frmSample.txtEmail

if ((emailID.value==null)||(emailID.value=="")){
alert("Please Enter your Email ID")
emailID.focus()
return false
}
if (echeck(emailID.value)==false){
emailID.value=""
emailID.focus()
return false
}
return true
}
</script>

<form name="frmSample" method="post" action="#" onSubmit="return ValidateForm()">
<p>Enter an Email Address :
<input type="text" name="txtEmail">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>

END

Thank you in advance.