Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mailto link in form

Status
Not open for further replies.

riffy

Programmer
Mar 29, 2001
106
US
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=&quot;mailto:&quot;> 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=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<script language=&quot;JavaScript&quot;>

<!-- hide javascript
function validate() {
if (document.joinus.fname.value == &quot;&quot;) {
alert(&quot;Sorry can't be anonymous&quot;);
document.joinus.fname.focus();
return false;
}
if (document.joinus.phone.value == &quot;&quot;) {
alert(&quot;We need to have a phone number&quot;);
document.joinus.phone.focus();
return false;
}
if (document.joinus.email.value == &quot;&quot;) {
alert(&quot;An email address would be nice&quot;);
document.joinus.email.focus();
return false;
}
if (document.joinus.subject.value == &quot;&quot;) {
alert(&quot;MUST know the subject&quot;);
document.joinus.subject.focus();
return false;
}
if (document.joinus.info.value == &quot;&quot;) {
alert(&quot;When are you available?&quot;);
document.joinus.info.focus();
return false;
}
document.joinus.submit();
}
//-->

</script>
</head>
<body background=&quot;unit.jpg&quot;>
<form name=&quot;joinus&quot; method=&quot;post&quot; action=&quot;mailto:muslimtutors@yahoo.com&quot; enctype=&quot;text/plain&quot; onSubmit=&quot;return validate();&quot;>
<table width=&quot;600&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot;>
<tr>
<td align=&quot;center&quot; colspan=&quot;2&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=3><b>Fill
out the form to join MTIA.</b></font><br>
<br>
</td>
</tr>
<tr>
<td align=&quot;right&quot; width=&quot;300&quot;><font face=&quot;arial, helvetica, sans-serif&quot; size=2>Name: </font></td>
<td width=&quot;300&quot;>&nbsp;&nbsp;<input type=&quot;text&quot; name=&quot;fname&quot;></td>
</tr>
<tr>
<td align=&quot;right&quot; width=&quot;300&quot;><font face=&quot;arial, helvetica, sans-serif&quot; size=2>Address: </font></td>
<td width=&quot;300&quot;>&nbsp;&nbsp;<textarea name=&quot;address&quot; rows=&quot;3&quot;></textarea></td>
</tr>
<tr>
<td align=&quot;right&quot; width=&quot;300&quot;><font face=&quot;arial, helvetica, sans-serif&quot; size=2>Phone: </font></td>
<td width=&quot;300&quot;>&nbsp;&nbsp;<input type=&quot;text&quot; name=&quot;phone&quot;></td>
</tr>
<tr>
<td align=&quot;right&quot; width=&quot;300&quot;><font face=&quot;arial, helvetica, sans-serif&quot; size=2>Email: </font></td>
<td width=&quot;300&quot;>&nbsp;&nbsp;<input type=&quot;text&quot; name=&quot;email&quot;></td>
</tr>
</table>
<br>
<br>
<table width=&quot;600&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;>
<tr>
<td align=&quot;center&quot; colspan=&quot;2&quot;>
<font face=&quot;arial, helvetica, sans-serif&quot; size=3><b>Your Information:</b></font><br><br>
</td>
</tr>
<tr>
<td align=&quot;right&quot; width=&quot;300&quot;><font face=&quot;arial, helvetica, sans-serif&quot; size=2>Preferred Subjects: </font></td>
<td width=&quot;300&quot;>&nbsp;&nbsp;<input type=&quot;text&quot; name=&quot;subject&quot;></td>
</tr>
<tr>
<td align=&quot;right&quot; width=&quot;300&quot;><font face=&quot;arial, helvetica, sans-serif&quot; size=2>Preferred Grades: </font></td>
<td width=&quot;300&quot;>&nbsp;&nbsp;<input type=&quot;text&quot; name=&quot;grade&quot;></td>
</tr>
<tr>
<td align=&quot;right&quot; width=&quot;300&quot;><font face=&quot;arial, helvetica, sans-serif&quot; size=2>Availability: </font></td>
<td width=&quot;300&quot;>&nbsp;&nbsp;<textarea name=&quot;info&quot; rows=4 wrap=&quot;virtual&quot;></textarea></td>
</tr>
<tr>
<td align=&quot;center&quot; width=&quot;300&quot;><br><input type=&quot;submit&quot; value=&quot;Send Info&quot;></td>
<td align=&quot;center&quot; width=&quot;300&quot;><br><input type=&quot;reset&quot;></td>
</tr>
</table>
</form>
</body>
</html>
 
You can do it that way, but how often do you ever see it on the web - that's right, never, it's fairly unprofessional looking don't you think? You're going tohave to look server side, if you know and have Java - a servlet is a piece of cake.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top