Structure d’un formulaire HTML Flashcards

1
Q

What is the main tag used to create a form in HTML?

A

<form>

## Footnote

The <form> tag is essential for creating forms in HTML.
</form></form>

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

What does the ‘name’ attribute in a form specify?

A

This attribute helps identify the form when submitted.

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

What are the two methods available for form submission?

A
  • get
  • post

‘get’ sends data via URL, while ‘post’ sends data to the server.

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

What is the purpose of the ‘action’ attribute in a form?

A

Specifies the URL of the program to process the data

This attribute determines where the form data is sent upon submission.

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

What HTML tag is used for a simple text input field?

A

<input></input>

This tag allows users to enter text.

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

Which tag is used for creating a password input field?

A

<input></input>

This tag hides the input text for security.

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

How do you create a checkbox input in HTML?

A

<input></input>

This tag allows users to select multiple options.

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

What is the HTML tag for creating radio buttons?

A

<input></input>

Radio buttons allow selection of one option from a set.

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

What is the HTML structure for a dropdown list?

A

<select></select>

Dropdown lists enable users to select one option from a list.

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

What HTML tag is used for a multi-line text input?

A

<textarea>

## Footnote

This tag allows users to enter larger amounts of text.
</textarea>

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

What is an example of local validation using JavaScript?

A

<form>

## Footnote

This ensures the form is validated before submission.
</form>

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

What does the ‘required’ attribute do?

A

Makes the field mandatory

Users must fill out this field before submitting the form.

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

What is the purpose of the ‘placeholder’ attribute?

A

Provides temporary guidance text for the user

This text disappears when the user starts typing.

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

What does the ‘pattern’ attribute validate?

A

The format of the entered data

This is useful for formats like postal codes.

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

What is the difference between ‘readonly’ and ‘disabled’ attributes?

A
  • readonly: Field is read-only
  • disabled: Field is disabled and cannot be interacted with

Both attributes affect user interaction with form fields.

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

What do ‘size’ and ‘maxlength’ attributes control?

A
  • size: Controls the visible width of the input
  • maxlength: Limits the number of characters

These attributes help manage user input.

17
Q

How can CSS styles be applied to form elements?

A

Using styles like:

css 
input, select, textarea { 
  border: 1px solid #ccc; 
  padding: 8px; 
  margin: 5px; 
} 

This example demonstrates basic styling for form elements.

18
Q

What is the first step in creating a form?

A

Insert a <form> tag into the page

This establishes the starting point for the form structure.

19
Q

What should be added after the <form> tag?

A

Sections and fields (using tables or divisions)

This organizes the content within the form.

20
Q

What is the last step in configuring a form?

A

Link the form to a processing program via the ‘action’ attribute

This is crucial for data submission.