Log in

View Full Version : Buttons working in forms



Freeman
10-04-2005, 04:18 PM
Here is a form that i wrote. Im pretty sure that my scripting is correct but no guarentees. With the button for submitting I would like to have it mail directly to my E-mail address by clicking on the submit button and nothing else. I would also like to know what page they would get after they clicked the submit button. Thanks for the help. JF


<html>
<body>
<hr color="003466">
<form name="reg" action="mailto:E-mail" method="post" encrypt="text/plain">

<!--e-mail address of the recipient -->
<input type="hidden" name="email" value="E-mail">

<table with="100%">
<tr>
<td width="100">
First Name

</td>
<td>
<input type="text" name="fname" id="fname" size="30">
Last Name
<input type="text" name="lname" id="lname" size="30">
</td>
</tr>

<table width="100%">
<tr>
<td width="100" valign="top">
<label for="comments">Questions or Comments</label>
</td>
<td valign="top">
<textarea name="comments" id="comments" rows="6" cols="50" wrap="hard">
</textarea>
</td>
</tr>


<tr>
<td width="100">
E-mail Address
</td>

<td>

<input type="text name="e-mailaddress" id="e-mailaddress">
<!-- Buttons -->
<tr>
<td valign="top" colspan="2" align="center">
<input type="submit" value="Send">
<input type="reset" value="Reset">
</td>
</tr>

</table>
</form>
<hr color="003466">
</body>
</html>

mwinter
10-04-2005, 09:08 PM
With the button for submitting I would like to have it mail directly to my E-mail address [...]Use a server-side form processor to do this. The mailto scheme is not reliable. There are plenty of free services (http://cgi.resourceindex.com/Remotely_Hosted/Form_Processing/) available, though your host may supply its own.


<hr color="003466">Hexadecimal colour values must be prefixed by a hash (#) character: #003466. A later horizontal rule (hr) also has this problem, too.


<form name="reg" action="mailto:E-mail" method="post" encrypt="text/plain">I doubt you need a name attribute, and there is no encrypt attribute anywhere in HTML. There is an enctype attribute for forms, but its use is rarely necessary (file uploads, usually).


<input type="hidden" name="email" value="E-mail">A decent form processor will not require you to include your e-mail address in the markup. If you are told to include it, you should check that using a different address (perhaps a temporary Yahoo! account) will cause the submission to fail. There have been some badly written scripts over the years which could be hijacked for sending spam. No-one should use them, but it doesn't hurt to make sure.


<table with="100%">Typo: width, not with.


</tr>

<table width="100%">This is invalid markup: the table element here must either be separate, in which case you should close the previous one, or it must be completely contained within a cell.


<input type="text name="e-mailaddress" id="e-mailaddress">You missed the closing quote for the type attribute value.

Hope that helps,
Mike

Freeman
10-05-2005, 01:46 PM
Now that i have fixed the little mistakes how do I make it send to a cgi site. I have on set up now is it <form name="reg" action="http://www.website.com/cgi/mailer" method="post"> Is this the correct way to have it send to my cgi account? Thanks for all the help. JF

mwinter
10-05-2005, 03:48 PM
[...] how do I make it send to a cgi site. I have on set up now is it <form name="reg" action="http://www.website.com/cgi/mailer" method="post"> Is this the correct way to have it send to my cgi account?It's entirely dependent upon the particular script; they're all different.

What service are you using? Do they not provide instructions?

Mike

Freeman
10-06-2005, 02:38 PM
Well it turs out that after I posted that last message I found the instrucions on their site. Thanks for the help. JF