Click to See Complete Forum and Search --> : Email form


dmb8886
05-29-2008, 06:41 PM
Can someone provide me code to that a user can submit their name and email address and click on a submit button and it emails me that info?

Thanks!

Fang
05-30-2008, 03:18 AM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>Basic mailto</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<script type="text/javascript">

</script>

<style type="text/css">
label {display:block;}
</style>

</head>
<body>
<form method="post" action="mailto:me@home.com?subject=feedback">
<div>
<label>Your name: <input type="text" name="name"></label>
<label>Your email: <input type="text" name="email"></label>
<label>Your comment: <textarea name="comment"></textarea></label>
<button type="submit">submit</button>
</div>
</form>
</body>
</html>

Use server side script (http://www.yourhtmlsource.com/cgi/processingforms.html) in preference to mailto (http://www.isolani.co.uk/articles/mailto.html)

Tezcatlipoca
05-30-2008, 12:26 PM
I can personally recommend this:

http://css-tricks.com/examples/NiceSimpleContactForm/

It's slick, fast, needs no cgi-bin scripts and is very easy to edit to suit your needs.

bluestartech
05-30-2008, 01:42 PM
a simple php/perl script can easily send an email and format the message as desired, there are too many to mention freely available

Fang
05-30-2008, 02:15 PM
I can personally recommend this:

http://css-tricks.com/examples/NiceSimpleContactForm/

It's slick, fast, needs no cgi-bin scripts and is very easy to edit to suit your needs.It's invalid and requires a server side script which is not supplied.

Your web host normally provides a generic form and a server side script.

Tezcatlipoca
05-30-2008, 02:38 PM
It's invalid and requires a server side script which is not supplied.

Your web host normally provides a generic form and a server side script.

Not correct; it validates fully in all W3C tests. You'll also find the site has a download link to grab all the files you need, which includes the php script that you say are not supplied.

Fang
05-31-2008, 07:31 AM
Incorrect:
<label for="Name" id="Name">Name:</label>
<input type="text" name="Name" />

Correct:
<label for="Name">Name:</label>
<input type="text" id="Name" name="Name" />

http://www.w3.org/TR/html401/interact/forms.html#edef-LABEL

Tezcatlipoca
05-31-2008, 08:07 AM
...and yet that form fully (http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fcss-tricks.com%2Fexamples%2FNiceSimpleContactForm%2F&profile=css21&usermedium=all&warning=1&lang=en) validates (http://validator.w3.org/check?uri=http%3A%2F%2Fcss-tricks.com%2Fexamples%2FNiceSimpleContactForm%2F&charset=%28detect+automatically%29&doctype=Inline&group=0).

Not that it really matters what the OP chooses to go with, the CSS form is just one of many methods, and, as bluestartech says, there are countless scripts out there that will also do the job.