Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

14. XHTML Forms: Getting Interactive > How form element names work

How form element names work

Here’s the thing to know about the name attribute: it acts as the glue between your form and the Web application that processes it. Here’s how this works:

Each input control in your form has a name attribute

When you type the elements for a form into your XHTML file, you give them unique names. You saw this with the text inputs:

image with no caption

When you submit a form, the browser packages up all the data using the unique names:

Say you type your name, address, city, state, and zip into the form and click submit. The browser takes each of these pieces of data and labels them with your unique name attribute values. The browser then sends the names and values to the server. Like this:

image with no caption

There are no Dumb Questions

Q:

Q: What’s the difference between a text <input> and a <textarea>?


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial