Hi all,
I have a site for this organization I'm part of and on it I've created a couple of forms for users to fill out if they want more information.
They just fill in the fields and the information is submitted via email. I've used javascript for it however it doesn't seem to be working.
Someone on the javascript forum said that I'm going to have to use either php or asp which is fine but I thought it's possible to submit a form just by using the <form action="mailto:"> tag?
I'm posting my code, if anyone can help it'll be greatly appreciated.
Thanks
Arif
<html>
<head>
<title>Request A Tutor</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!-- hide javascript
function validate() {
if (document.joinus.fname.value == "" {
alert("Sorry can't be anonymous"
document.joinus.fname.focus();
return false;
}
if (document.joinus.phone.value == "" {
alert("We need to have a phone number"
document.joinus.phone.focus();
return false;
}
if (document.joinus.email.value == "" {
alert("An email address would be nice"
document.joinus.email.focus();
return false;
}
if (document.joinus.subject.value == "" {
alert("MUST know the subject"
document.joinus.subject.focus();
return false;
}
if (document.joinus.info.value == "" {
alert("When are you available?"
document.joinus.info.focus();
return false;
}
document.joinus.submit();
}
//-->
</script>
</head>
<body background="unit.jpg">
<form name="joinus" method="post" action="mailto:muslimtutors@yahoo.com" enctype="text/plain" onSubmit="return validate();">
<table width="600" cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="center" colspan="2"><font face="Arial, Helvetica, sans-serif" size=3><b>Fill
out the form to join MTIA.</b></font><br>
<br>
</td>
</tr>
<tr>
<td align="right" width="300"><font face="arial, helvetica, sans-serif" size=2>Name: </font></td>
<td width="300"> <input type="text" name="fname"></td>
</tr>
<tr>
<td align="right" width="300"><font face="arial, helvetica, sans-serif" size=2>Address: </font></td>
<td width="300"> <textarea name="address" rows="3"></textarea></td>
</tr>
<tr>
<td align="right" width="300"><font face="arial, helvetica, sans-serif" size=2>Phone: </font></td>
<td width="300"> <input type="text" name="phone"></td>
</tr>
<tr>
<td align="right" width="300"><font face="arial, helvetica, sans-serif" size=2>Email: </font></td>
<td width="300"> <input type="text" name="email"></td>
</tr>
</table>
<br>
<br>
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" colspan="2">
<font face="arial, helvetica, sans-serif" size=3><b>Your Information:</b></font><br><br>
</td>
</tr>
<tr>
<td align="right" width="300"><font face="arial, helvetica, sans-serif" size=2>Preferred Subjects: </font></td>
<td width="300"> <input type="text" name="subject"></td>
</tr>
<tr>
<td align="right" width="300"><font face="arial, helvetica, sans-serif" size=2>Preferred Grades: </font></td>
<td width="300"> <input type="text" name="grade"></td>
</tr>
<tr>
<td align="right" width="300"><font face="arial, helvetica, sans-serif" size=2>Availability: </font></td>
<td width="300"> <textarea name="info" rows=4 wrap="virtual"></textarea></td>
</tr>
<tr>
<td align="center" width="300"><br><input type="submit" value="Send Info"></td>
<td align="center" width="300"><br><input type="reset"></td>
</tr>
</table>
</form>
</body>
</html>
I have a site for this organization I'm part of and on it I've created a couple of forms for users to fill out if they want more information.
They just fill in the fields and the information is submitted via email. I've used javascript for it however it doesn't seem to be working.
Someone on the javascript forum said that I'm going to have to use either php or asp which is fine but I thought it's possible to submit a form just by using the <form action="mailto:"> tag?
I'm posting my code, if anyone can help it'll be greatly appreciated.
Thanks
Arif
<html>
<head>
<title>Request A Tutor</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!-- hide javascript
function validate() {
if (document.joinus.fname.value == "" {
alert("Sorry can't be anonymous"
document.joinus.fname.focus();
return false;
}
if (document.joinus.phone.value == "" {
alert("We need to have a phone number"
document.joinus.phone.focus();
return false;
}
if (document.joinus.email.value == "" {
alert("An email address would be nice"
document.joinus.email.focus();
return false;
}
if (document.joinus.subject.value == "" {
alert("MUST know the subject"
document.joinus.subject.focus();
return false;
}
if (document.joinus.info.value == "" {
alert("When are you available?"
document.joinus.info.focus();
return false;
}
document.joinus.submit();
}
//-->
</script>
</head>
<body background="unit.jpg">
<form name="joinus" method="post" action="mailto:muslimtutors@yahoo.com" enctype="text/plain" onSubmit="return validate();">
<table width="600" cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="center" colspan="2"><font face="Arial, Helvetica, sans-serif" size=3><b>Fill
out the form to join MTIA.</b></font><br>
<br>
</td>
</tr>
<tr>
<td align="right" width="300"><font face="arial, helvetica, sans-serif" size=2>Name: </font></td>
<td width="300"> <input type="text" name="fname"></td>
</tr>
<tr>
<td align="right" width="300"><font face="arial, helvetica, sans-serif" size=2>Address: </font></td>
<td width="300"> <textarea name="address" rows="3"></textarea></td>
</tr>
<tr>
<td align="right" width="300"><font face="arial, helvetica, sans-serif" size=2>Phone: </font></td>
<td width="300"> <input type="text" name="phone"></td>
</tr>
<tr>
<td align="right" width="300"><font face="arial, helvetica, sans-serif" size=2>Email: </font></td>
<td width="300"> <input type="text" name="email"></td>
</tr>
</table>
<br>
<br>
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" colspan="2">
<font face="arial, helvetica, sans-serif" size=3><b>Your Information:</b></font><br><br>
</td>
</tr>
<tr>
<td align="right" width="300"><font face="arial, helvetica, sans-serif" size=2>Preferred Subjects: </font></td>
<td width="300"> <input type="text" name="subject"></td>
</tr>
<tr>
<td align="right" width="300"><font face="arial, helvetica, sans-serif" size=2>Preferred Grades: </font></td>
<td width="300"> <input type="text" name="grade"></td>
</tr>
<tr>
<td align="right" width="300"><font face="arial, helvetica, sans-serif" size=2>Availability: </font></td>
<td width="300"> <textarea name="info" rows=4 wrap="virtual"></textarea></td>
</tr>
<tr>
<td align="center" width="300"><br><input type="submit" value="Send Info"></td>
<td align="center" width="300"><br><input type="reset"></td>
</tr>
</table>
</form>
</body>
</html>