Forms Flashcards

1
Q

What attributes are required in a form element?

A

action, method, and id

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

action attribute

A

its value is the URL for the page on the server that will receieve the information in the form when it is submitted

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

method attribute

A
  • get method
    • the values from the form are added to the end of the URL
    • ideal for:
      • short forms (such as search boxes)
      • when you are just retrieving data from the web server
  • post method
    • the values are send in what are known as HTTP headers
    • ideal if your form:
      • allows users to upload a file
      • is very long
      • contains sensitive data (e.g. passwords)
      • adds information to, or deletes information from, a database
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

input name attribute

A
  • the server needs to know what has been entered as the username and what has been given as the password
  • therefore, each fomr control requires a name attribute
  • the value of this attribute identifies the form control and is sent along with the information they enter to the server
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

text input code

A

(input type=”text” name=”” /)

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

password input code

A

(input type=”password” name=”” /)

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

textarea code

A

(textarea name=”“)Some Text(/textarea)

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

radio input code

A

(input type=”radio” name=”” /)

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

checkbox input code

A

(input type=”checkbox” name=”” /)

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

drop drown list code

A

(select name=””)

(option value=”“)Option 1(/option)

(option value=”“)Option 2(/option)

(/select)

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

file input box code

A

(input type=”file” name=”” /)

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

submit button code

A

(input type=”submit” name=”” value=”Submit” /)

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

image button

A

(input type=”image” src=”” /)

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

button code

A

(button)(img src=”” alt=”” /)Text(/button)

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

labelling form controls code

A

(label)Text(input type=”” name=”” /)(/label)

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

grouping form controls code

A

(fieldset)

(legend) Text(/legend)
(label) (input type=”” name=””)(/label)
(label) (input type=”” name=””)(/label)
(label) (input type=”” name=””)(/label)

(/fieldset)

17
Q

HTML5: form validation attribute

A

(input type=”” required=”required” /)

18
Q

HTML5: date input code

A

(input type=”date” name=”” /)

19
Q

HTML5: email input

A

(input type=”email” name=”” /)

20
Q

HTML5: url input

A

(input type=”url” name=”” /)

21
Q

HTML5: search input

A

(input type=”search” name=”” /)

22
Q

HTML5: placeholder attribute

A

placeholder=”Enter keyword”