Help - Search - Members - Calendar
Full Version: Making a web form ?
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
Focus1
Hi guys, as I'm getting the jist of HTML I'm excited and eager to learn how to make forms for my websites, but can't really find a good place to find the code.

I've had a look on amazon.co.uk to try find a good book specifically on how to make web forms but after reading lots of reviews, I'm a little on the cautious side about purchasing any of them.

I do understand to make the forms work fully I will have to use php and thats the next step I will take but first I'd like to know how to make a form.

For starters, I'd like to have a contact us page with a first name, second name, the users email address and a space for the comment/question. Any suggestions on a good book or source for finding the code for making forms ?

After I learn how to make a fully working form, my next step will be a site that people can log into but first things first I guess smile.gif

All help/info appreciated!

Focus
pandy
QUOTE(Focus1 @ Jul 17 2012, 01:50 AM) *

I do understand to make the forms work fully I will have to use php



Or some other serverside programming language.

I don't know if there is a book specifically on forms, but I don't think you need one. You can find a lot on the web.

For the structure of the form, there isn't much to learn. You just need to know what form controls there are.
http://htmlhelp.com/reference/html40/forms/
Read what each one of those does and start to play with them so you see how they look and function. You basically need the FORM (of course), a submit button and any number of other form controls that you need.

Fill in the dots...
CODE
<form action="YourScript.php"...>
   <fieldset>
      <legend>Your Inforation</legend>
      <label for="name">Name</name> <input name="name" id="name">
      ...
   </fieldset>

   <fieldset>
      <legend>Other stuff</legend>
      <label for="foo">Whatever</name> <input name="foo" id="foo">
      ...
   </fieldset>

   <input type="submit">
</form>


You don't need FIELDSET and LABEL really, but I think they are nice.

Then, to make the form look nice you need CSS.
http://htmlhelp.com/reference/css/
Christian J
QUOTE(pandy @ Jul 17 2012, 05:36 AM) *

For the structure of the form, there isn't much to learn. You just need to know what form controls there are.
http://htmlhelp.com/reference/html40/forms/
Read what each one of those do and start to play with them so you see how they look and function you are all set.

There are even more form elements in HTML5. Here's a demo: http://www.coreservlets.com/html5-tutorial/input-types.html, but since browser support still varies you may not see some of the elements even in the latest versions.
pandy
Don't you think HTML5 is biting over too much for someone who has never created a form before though?
Christian J
Just wanted to mention that it exists. mellow.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.