collie
08-13-2003, 11:24 PM
Confused on how this script works. After the form is filled in and the submit button is than hit. What lines have to be changed so that i would receive the form info. There are two lines within this script that i dont understand. thanks in advance
<form method=post action=http://cgi.freedback.com/mail.pl"
(this line the post action i dont know what its trying to do)
<inpuy type=hidden name=to value="you@your-website-address-here.com">( on this line you@ i dont understand)
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
var submitcount=0;
function reset() {
document.emailform.name.value="";
document.emailform.email.value="";
document.emailform.comments.value="";
}
function checkFields() { // field validation -
if ( (document.emailform.name.value=="") || // checks if fields are blank.
(document.emailform.email.value=="") || // More validation scripts at
(document.emailform.comments.value=="") ) // forms.javascriptsource.com
{
alert("Please enter your name, email, and comments then re-submit this form.");
return false;
}
else
{
if (submitcount == 0)
{
submitcount++;
return true;
}
else
{
alert("This form has already been submitted. Thanks!");
return false;
}
}
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Insert the onLoad event handler into your BODY tag -->
<BODY OnLoad="reset()">
<!-- STEP THREE: Copy this code into the BODY of your HTML document -->
<form method=post action="http://cgi.freedback.com/mail.pl" name="emailform" onSubmit="return checkFields()">
<input type=hidden name=to value="you@your-website-address-here.com">
<input type=hidden name=subject value="Feedback Form">
<pre>
Your Name: <input type=text name="name">
Your Email: <input type=text name="email">
Comments?
<textarea name="comments" wrap="virtual" rows="7" cols="45"></Textarea>
<input type=submit value="Submit Form!">
</pre>
</form>
</html>
<form method=post action=http://cgi.freedback.com/mail.pl"
(this line the post action i dont know what its trying to do)
<inpuy type=hidden name=to value="you@your-website-address-here.com">( on this line you@ i dont understand)
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
var submitcount=0;
function reset() {
document.emailform.name.value="";
document.emailform.email.value="";
document.emailform.comments.value="";
}
function checkFields() { // field validation -
if ( (document.emailform.name.value=="") || // checks if fields are blank.
(document.emailform.email.value=="") || // More validation scripts at
(document.emailform.comments.value=="") ) // forms.javascriptsource.com
{
alert("Please enter your name, email, and comments then re-submit this form.");
return false;
}
else
{
if (submitcount == 0)
{
submitcount++;
return true;
}
else
{
alert("This form has already been submitted. Thanks!");
return false;
}
}
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Insert the onLoad event handler into your BODY tag -->
<BODY OnLoad="reset()">
<!-- STEP THREE: Copy this code into the BODY of your HTML document -->
<form method=post action="http://cgi.freedback.com/mail.pl" name="emailform" onSubmit="return checkFields()">
<input type=hidden name=to value="you@your-website-address-here.com">
<input type=hidden name=subject value="Feedback Form">
<pre>
Your Name: <input type=text name="name">
Your Email: <input type=text name="email">
Comments?
<textarea name="comments" wrap="virtual" rows="7" cols="45"></Textarea>
<input type=submit value="Submit Form!">
</pre>
</form>
</html>