HTML Contact Form

shaun.121

New Member
Hi, I'm a web designer and really need helping making a contact form, just with a name, email address and comment. I've search the web but all the html or php templates I find, i cant figure out how it works.

PLEASE HELP!!!
 

chrishirst

Well-Known Member
Staff member
HTML:
<form method="post" action="" name="formname">
    Email Address:<input type="text" name="email"><br>
    Name:<input type="text" name="username"><br>
    Comments: <br><textarea rows="10" cols="5"></textarea><br>
    <input type="submit" value="Send Message">
</form>
 
Last edited:

Roddy

New Member
Contact Form & Formmail Script

A contact form needs some html, and css to style it, along with a formmail script on your server to process the form info.

Here's a link to a well designed form by a master of CSS...

http://css-tricks.com/nice-and-simple-contact-form/

The form needs a method and an action.

<form method="post" action="http://domain-name.com/formmail.php">

As you can see, the action is the URL to the script on the server.

The contact form download mentioned above contains a php script which you can easily modify for your own use. It also has a script for a thank you message which acknowledges receipt of the message.

Alternatively, you can return visitors to a "thank you" page on your site - or any other page for that matter - by including this...

<input type="hidden" name="good_url" value="URL to the page" />

If you really don't want to get into all this you can use a form service. Google "website form service" to find all the usual suspects.
 

Edge

Member
HTML:
<form method="post" action="" name="formname">
    Email Address:<input type="text" name="email"><br>
    Name:<input type="text name="username"><br>
    Comments: <br><textarea rows="10" cols="5"></textarea><br>
    <input type="submit" value="Send Message">
</form>

I suspect above is part irony hence the missing labels and use of <br>...
 

chrishirst

Well-Known Member
Staff member
Nope just a quickly thrown together form, no thought of niceties involved whatsoever.
 
For someone who likes to bash everything, I find it ironic when someone asks for help with a form, you give a half assed answer and call labels a "nicety" when they are slightly more than that.
 

chrishirst

Well-Known Member
Staff member
When you first started making HTML forms, did YOU use fieldsets, labels, CSS styling etc.?


Or did that come along after you had learned the basics of HTML and needed to progress??
 

chrishirst

Well-Known Member
Staff member
Now there is the entire issue
The label element is NOT necessarily the "right" thing to do and for a SIMPLE demonstration of an HTML form not even necessary.

If you READ the original post it seems that the OP was ALREADY confused by what he or she had read, would it serve to lessen the confusion by including extra code that is NOT strictly necessary for the purposes of a SIMPLE example.

Would you provide an example of differential calculus when illustrating the principles of long division.

Sure, if I had been providing an example of a form that was created for accessibilty and usabilty I would have included fieldsets, labels along with accesskey and tabindex attributes but they are also unnecessary for a basic and SIMPLE example.
Are you also going to take W3Schools to task because their SIMPLE example uses line breaks and is without labels and fieldsets.

When trying to teach people something it pays to start at a basic and therefore simple level and build on that foundation.
 
Top