Prev | Current Page 398 | Next

Craig Grannell

"The Essential Guide to CSS and HTML Web Design"

In such cases, users will likely either go elsewhere or insert fake data, which helps
no one.
So, keep things simple and use the fewest fields possible. In the vast majority of cases, you
should be able to simply create name, e-mail address, and phone number fields, and
include a text area that enables users to input their query.
Enkoder is also available as a plug-in for Ruby on Rails.
GETTING USER FEEDBACK
315
8
Creating a form
Form controls are housed within a form element, whose attributes also determine the
location of the script used to parse it (see the ???Sending feedback??? section later in the
chapter). Other attributes define the encoding type used and the method by which the
browser sends the form??™s data to the server. A typical start tag for a form therefore looks
like this:
?? method="post">
Adding controls
Some form controls are added using the input element. The type attribute declares what
kind of control the element is going to be. The most common values are text, which produces
a single-line text input field; checkbox and radio, which are used for multiplechoice
options; and submit, which is used for the all-important Submit button.
Other useful elements include select, option, and optgroup, used for creating pop-up
lists, and textarea, which provides a means for the user to offer a multiple-line response
(this is commonly used in online forms for a question area).


Pages:
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410