Click to See Complete Forum and Search --> : email forms


SaLiEtAta
10-28-2003, 11:41 AM
i am trying to make a form for a web page that will people will have to include their name, email address, and question.. i found some javascript and i tried putting everything together and it is not working for me. it is supposed to tell them if they did not enter in the correct info, and it when it goes through, it should email me and then go to my "thanks.html" page .can someone please help me ? this is waht i have so far..
for the head:
<head>
<script language="JavaScript">

<
function checkFields() {
missinginfo = "";
if (document.form.name.value == "") {
missinginfo += "\n Name";
}
if ((document.form.from.value == "") ||
(document.form.from.value.indexOf('@') == -1) ||
(document.form.from.value.indexOf('.') == -1)) {
missinginfo += "\n Email Address";
}
if(document.form.question.value == "") {
missinginfo += "\n Question";
}

if (missinginfo != "") {
missinginfo ="===================================\n" +
"You are so dumb, why don't you learn how to fill in your:\n" +
missinginfo + "\n===================================" +
"\n try again, maybe this time you can do it....";
alert(missinginfo);
return false;
}
else return true;
}>
</script>
</head>

then i have in the body:
<form action="thanks.html" name=form onSubmit="return checkFields();">
<font face="Georgia, Times New Roman, Times, serif"> <font size="-1">
<input type=hidden name=to value="jason@accidentjacket.com">
<input type=hidden name=subject value="thanks.html">

</font></font>
<pre><font face="Georgia, Times New Roman, Times, serif">
Name: <br><input type=text name="name" size=25>
E-mail: <br><input type=text name="from" size=25>
Question:</font><font size="-1" face="Georgia, Times New Roman, Times, serif"><br>
<textarea rows=5 cols=20 name="question"></textarea>

</font><font size="-1"><center><font face="Georgia, Times New Roman, Times, serif"><input type=submit name="submit" value="Ask Jason!"></font></center><font face="Georgia, Times New Roman, Times, serif">
</font></font></pre>
</form>
</body>

i would appreciate any info or any ways to make this better or easier.. thanks a bunch
jason

SaLiEtAta
10-28-2003, 12:11 PM
help please im a sad puppy

halifaxrick
10-28-2003, 03:22 PM
Couple of things:

1. you have a couple of typos.

<head>
<script language="JavaScript">

< <--- Delete this
function checkFields() {

}
else return true;
}> <--- Delete this (just the >)
</script>

2. The action of your form just takes the user to another web page, it should either be a mailto: or some sort of server side mail thingy.

SaLiEtAta
10-28-2003, 10:18 PM
ok ill try it out thanks a bunch :D