forms Flashcards

1
Q

what is a form?

A

a form is a way to collect information from website users

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is the best known form on the web?

A

the google search box

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is a form control?

A

a form control is a way in which you can specify how information is gathered on the web

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what is a text input

A

a text input is a form control that allows the user to enter single lines of text

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what are text inputs used for?

give an example

A

text inputs are used for gathering single line amounts of information.

example: username, email address

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what are password inputs?

A

password inputs are like text input except the information entered appears as bullets to ensure passwords are kept hidden

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what is a text area?

A

a text area is a form control that allows multi line information

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what are text areas used for?

A

text areas are used for messages such as comments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what is a radio button?

A

a radio button is a form control that allows a user to select one out of a number of options

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what is a drop down box?

A

a drop down box allows a user to select on out of a number of options displayed in a drop down menu

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what is a submit button?

A

a submit button is a button used to submit the information entered into the form to another webpage

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

how does a form work?

A

1) a user fills in a form and presses a button
2) the name of each form control is sent to the server with the values the user entered
3) the server processes the information using programming languages such as python and php
4) the server creates a new page to send back to the users browser browser based ion the information received

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

how can a server differentiate between different form controls and the information sent?

A

the server can distinguish what information came from what form control by using a name/value pair

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what is a name/value pair?

A

a name/value pair is a combination of the name of the form control and the value entered, therefore it is vital that each form control has a name attribiute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what is the basic form structure?

A

1) form element
2) attributes: action and method for the form element
3) some form control elements
4) submit button

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

what is the action attribute?

A

the action attribute required in every form, its value is the URL for the page on the server that will receive the information of the form when submitted.

the action attribute can be thought of as a finger pointing to the destination of the information.

17
Q

what is the method attribute?

A

the method attribute specifies which way a form can be sent: get or post

18
Q

what is the post method?

A

the post method is one way in which a form can be sent, the post method uses HTTP headers to send the values of the form. post- like the post service something is sent in the post, data from the form is sent

19
Q

what is the get method?

A

with the get method the values from the form are added to the end of the URL specified in the action attribute in order to receive data. get = receiving

20
Q

describe when the post method should be used

A

the post method should be used when:
the form contains sensitive data - passwords
adds information to, or deleted form a database

21
Q

describe when the get method should be used?

A

the get method should be used when:

when you are just receiving data from the web server

22
Q

describe the difference between the get and post methods

A

post- sends data, get- receives data

post- adds or deletes from database get- no interaction with database

23
Q

what is the correct HTML markup for a text input?

A

(input type = “text” name = “firstname”)

24
Q

describe the input element

A

the input element is used for most form controls

has an attribute if type- used to change the type of input

self closing tag