Chapter 9 - Forms Flashcards
two parts to a working form
the form you see on the page itself, an application or script on the server that processes the information collected by the form and returns an appropriate response
form controls
buttons, input fields, and drop down menus used to collect information from the user
submit
submitting a form for processing
<form>...</form>
interactive form
action attribute
provides the location (URL) of the application or script that will be used to process the form
six technologies that can process web forms
PHP, Microsoft ASP, Microsoft’s ASP.NET, Ruby on Rails, JavaServer Pages, Python
two ways to get your forms to work if you’re not a programmer
use hosting plan goodies, hire a programmer
method attribute
specifies how the information should be sent to the server
two methods for sending encoded data to the server
POST, GET
GET method
the encoded form gets tacked right onto the URL sent to the server; appropriate if the form submission performs an action, such as deleting something or adding data to a database, because if the user goes back, it gets submitted again; character limit
POST method
the browser sends a separate server request containing some special headers followed by the data; only the server sees the content of the request, so this is the best method for sending secure information such as a home address or other personal information; also preferable for sending a lot of data; no character limit
name attribute
provides the variable name for the control
variable
one bit of information from a user
value (content)
the data entered by the user
input element
single line of text
textarea element
multiple lines
<input></input>
single-line text-entry control
name attribute
required for indicating the variable name
value attribute
specifies default text that appears in the field when the form is closed
placeholder attribute
provides a hint of what to type in the field
maxlength attribute
set a maximum character limit
minlength
set a minimum character limit
<textarea>...</textarea>
multiline text-entry control
<input></input>
password text control
<input></input>
search field
<input></input>
email address
<input></input>
telephone number
<input></input>
location (URL)
<datalist>...</datalist>
drop-down menu input