Free Practice Quiz Question List

7 Forms and User Input Online Quiz Questions

Use this free practice quiz with 20 questions to review 7 Forms and User Input, test your knowledge, and prepare for your next test or exam.

20 questions
01
Fill in the blank
1 point

When a form uses the GET method, the browser places its values in the .

02
Written response
1 point

Which HTML attribute identifies a control's value in submitted form data? Enter the attribute name.

03
True or false
1 point

A form control has a visible label whose for value matches the control's id. This connection can help people using assistive technology identify and navigate the control.

  1. A

    True

  2. B

    False

04
Choose one
1 point

A form submits or changes data, and its values should be sent in the request body rather than placed in the URL. Which method best fits?

  1. A

    GET, because it places values in the request body

  2. B

    POST, because it sends values in the request body

  3. C

    GET, because it sends values only to the server

  4. D

    POST, because it places values in the URL

05
Fill in the blank
1 point

To explicitly connect a label to its control, use matching values on the label and the control.

06
True or false
1 point

An application listens for a form's submit event instead of only listening for a submit-button click. This allows it to handle submission initiated by keyboard as well.

  1. A

    True

  2. B

    False

07
Choose one
1 point

A form uses browser constraints to improve usability. Which additional step is necessary to protect the application when data is submitted?

  1. A

    Rely on browser constraints because users cannot change them

  2. B

    Validate only when a field uses the email input type

  3. C

    Validate submitted data on the server as well as using client-side checks for usability

  4. D

    Skip validation for requests sent without the page

08
Choose one
1 point

A message field must contain at least 10 characters. Which implementation both applies a native HTML constraint and clearly informs users of the requirement?

  1. A

    Set minlength without explaining the requirement to users

  2. B

    Set minlength and explain the minimum in visible text

  3. C

    Put the minimum only in a JavaScript comment

  4. D

    Rely on an error color to communicate the minimum

09
Choose all
1 point

Select all statements that accurately describe form control names and browser assistance for data entry.

  1. A

    A control's name identifies its value in submitted form data

  2. B

    A control without a name is always included in submitted form data

  3. C

    Choosing an appropriate input type and useful autocomplete values can help browsers and users enter data

  4. D

    The autocomplete attribute determines where the form sends its data

10
Written response
1 point

In a JavaScript submit event handler, which method should you call to stop the browser's default navigation when your code will handle the form data? Enter the method name, including parentheses.

11
Choose one
1 point

A form's values are being sent to /contact, but the submission is not processed. Which statement best describes the role of the form's destination setting and the server?

  1. A

    The method specifies the endpoint, so configuring the server is unnecessary

  2. B

    The action specifies the destination, and the server must be configured to receive and process the submission

  3. C

    The name specifies the destination, and the browser processes the submission

  4. D

    The autocomplete specifies the destination, and the browser stores the submission

12
Choose one
1 point

After JavaScript handles a form submission, which approach provides clear feedback that is also associated with assistive technology?

  1. A

    Change the submit button color without adding text

  2. B

    Write the result only to the browser console

  3. C

    Update a status element configured with role="status" and aria-live="polite"

  4. D

    Show feedback in an unrelated part of the page without identifying it

13
Choose all
1 point

Select all statements that accurately describe browser validation and JavaScript-triggered form submission.

  1. A

    requestSubmit() follows normal validation and submit-event behavior

  2. B

    form.submit() bypasses both normal validation and submit-event behavior

  3. C

    The browser normally performs constraint validation before firing the submit event

  4. D

    form.submit() always fires the submit event after checking constraints

14
Open ended
1 point

Describe how a server-backed form should handle submitted data and communicate the outcome to users.

15
Choose one
1 point

In an HTML form, how do you explicitly associate a visible label with its input control?

  1. A

    Give the label and control the same name attribute.

  2. B

    Set the label’s for value to the control’s id.

  3. C

    Place the label after the control and omit its for attribute.

  4. D

    Set the label’s id to the control’s name.

16
Choose one
1 point

You are building a set of related radio buttons. Which HTML structure provides a semantic group and a descriptive title for that group?

  1. A

    Use a paragraph to group controls and a placeholder as its heading.

  2. B

    Use a label around all the controls and give it a name attribute.

  3. C

    Use a fieldset to group the controls and a legend to describe the group.

  4. D

    Use a form element for each control and an option element as the group title.

17
Choose one
1 point

A form submits a search query, and the application is designed for the submitted values to appear in the URL. Which method best fits this use?

  1. A

    GET

  2. B

    POST

  3. C

    FormData

  4. D

    requestSubmit()

18
Written response
1 point

In an HTML form, which attribute specifies where the browser sends the submitted data? Enter the attribute name.

19
Written response
1 point

Which form event should JavaScript listen for so that keyboard-based submission is handled as well as button-initiated submission? Enter the event name.

20
True or false
1 point

In JavaScript, calling requestSubmit() follows normal constraint validation and submit-event behavior, while calling form.submit() bypasses both.

  1. A

    True

  2. B

    False