Part 6 - Working with forms and collecting data Flashcards
what is a disadvantage of
Common gateway interface (CGI)
a disadvantage of this is that Every form returned to the server requires a new process to be created for the CGI script
describe the html tag
<.textarea></.textarea>
This tag can be used within a form to allow the user to enter multi line data such as an address or a comment or review. Any initial value can be supplied within the element itslef (ie between the tags)
what is the markup to:
1. create a hidden field
2. give it a unique identification of “a_name”
3. give it a default value of “a_value”
describe the following markup
<.input type=”hidden” name=”a_name” value=”a_value” />
describe the action attribute of the html form element
this is used to define where the form will be sent such as to a script on a server
describe the
name attribute
of the html input tag
this provides an identification for the tag which can be used by css or javascript
this can be accomplished by:
<.fieldset>
<.legend>Personalia:</.legend>
<.input>
…
…
</.fieldset>
**explained** <.fieldset> - this creates a boxing around our inputs <.legend> - this creates a legend for the boxed section
how can we divide our form up into sections
this provides an identification for the tag which can be used by css or javascript
describe the
name attribute
of the html input tag
this can be accomplished using:
Username: <.input type=”text” name=”user” />
how would we create a
username field
in a HTML form
describe the following markup
<.input type=”reset” name=”reset” value=”Reset” />
what is the markup that:
1. create a reset button
2. give it a unique identifier of reset
3. give the button text that says “reset”
this is the name/value data in the url after the ? and is seen when the http get method is used to send form data
what is a
query string
This defines the HTTP request method we would like to use such as GET or POST
describe the
method
attribute of the html form element
what is the role of a
firewall
Its role is to determine which packets should and should not be accepted:
This can occur when a server makes a request to you or even when you request data from a server.
this attribute when used with a radio button defines the group it belongs to (if this is selected other members of the group are deselected)
in the context of a html radio button describe the
name attribute
this is HTTP but is secured (encrypted) using the ssl/tls protocol
describe HTTPS
tells how to encode form data when the form method is ‘post’ (most commonly this is used to allow PHP, which you will encounter in Block 2, to accept file uploads).
describe the
enctype
attribute of the html form element
using this tag increases the accessibility of form fields by:
1.This will be read by screen readers
2.This itself acts as selectable so elements such as a radio button have a higher hit area
why should the <.label> tag be used with form fields to increase accessibility
give 2 reasons
this is used to define where the form will be sent such as to a script on a server
describe the action attribute of the html form element
this attribute can be used to have radio button selected by default
in the context of a html radio button describe the
** checked attribute**
describe how the html
type=”reset”
of the input tag works
Often ommited but can be used to reset all the form data back to there default values
describe the following markup
<.input type=”hidden” name=”a_name” value=”a_value” />
what is the markup to:
1. create a hidden field
2. give it a unique identification of “a_name”
3. give it a default value of “a_value”
this attribute specifies the maximum number of characters allowed in an input field.
describe the
maxlength attribute
of the html input tag
this is done using
<.form></.form>
how do we create a html form element
how can we divide our form up into sections
this can be accomplished by:
<.fieldset>
<.legend>Personalia:</.legend>
<.input>
…
…
</.fieldset>
**explained** <.fieldset> - this creates a boxing around our inputs <.legend> - this creates a legend for the boxed section
this can be accomplished using:
<.input type=”file” name=”upload1”/>
how do we create a
file upload button
in html
when this is being used the form element must have
enctype=”multipart/form-data”
this is required in the form element when submitting files. This tells the server to expect one or more attached files
what is required in the form element when using the input type “file”
this provides an initial value for the input tag
describe the
value attribute
of the html input tag
what 2 methods can be used to bound a <.label> tag to a <.input> tag
this can be accomplished by:
1.<.label for=”ID of input”><./label>
2.Nesting the input inside the label
what is the markup to
create a radio button
the markup is:
<.input type=”radio”>
describe the global attribute
tabindex
this can be used to control the flow of focus when the keyboard is being used
When the form is submitted using this method the name/value pairs are appended to the url after a question mark (?)
NOTE: this method is insecure
describe how a form is submitted when the method is GET
in the context of a html radio button describe the
name attribute
this attribute when used with a radio button defines the group it belongs to (if this is selected other members of the group are deselected)
this can be used to control the flow of focus when the keyboard is being used
describe the global attribute
tabindex
Its role is to determine which packets should and should not be accepted:
This can occur when a server makes a request to you or even when you request data from a server.
what is the role of a
firewall
how do we create a html form element
this is done using
<.form></.form>
describe how the html
type=”submit”
of the input tag works
this will create a button that when pressed will send the form data to The form-handler which is specified in the form’s action attribute.
this can be accomplished using:
Password: <.input type=”password” name=”password” />
how would we
create a password field
in a html form