Forms Updated Flashcards

1
Q

How do forms work?

A
  • A users fills in the form.
  • The user then submits the form. The name and value of each form control the user selects is sent to the server
  • The server processes the submitted info (Possibly it will store this in a database)
  • The server sends a message back to the user
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do forms work?

A
  • A users fills in the form.
  • The user then submits the form. The name and value of each form control the user selects is sent to the server
  • The server processes the submitted info (Possibly it will store this in a database)
  • The server sends a message back to the user
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What HTTP methods are used to send user information to the server?

A

GET

POST

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

How do we add a form to a page?

A

Looking at the form attributes

id = We use an ID attribute to help identify the form and so we can work with it easily
method = This is the http method used to send information to the server
action = points to a script to process the submitted form
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you add a text field to a form?

A

Use an input tag with the type attribute set to text. It’s an empty element so we don’t have a separate closing tag.

Let’s look at the attributes

name = The name attribute identifies the form element
maxlength = restricts how many characters the user can enter
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What HTTP methods are used to send user information to the server?

A

GET

POST

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

How does the server understand the data is sent by the user?

A

The data is submitted in name/value pairs. The name comes from the form element, and the value from what the user enters into that element

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

How do we add a form to a page?

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

How do you add a text field to a form?

A

Use an input tag with the type attribute set to text. It’s an empty element so we don’t have a separate closing tag.

Let’s look at the attributes

name = The name attribute identifies the form element
maxlength = restricts how many characters the user can enter
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you add a password field to a form?

A

Use an input tag with the type attribute set to password. It’s an empty element so we don’t have a separate closing tag.

A password input will mask the characters entered into the field. Generally, they’ll show up as dots.

Let’s look at the attributes

name = The name attribute identifies the form element
maxlength = restricts how many characters the user can enter
How well did you know this?
1
Not at all
2
3
4
5
Perfectly