Bootstrap MCQs – Forms and Inputs

11.) How do you disable a form input in Bootstrap?

A) .form-disable
B) .form-readonly
C) disabled attribute
D) .input-disabled

Answer: Option C

Explanation: The disabled attribute prevents user interaction with the input field.

12.) Which class is used to create a form select dropdown in Bootstrap?

A) .form-select
B) .form-dropdown
C) .select-control
D) .input-dropdown

Answer: Option A

Explanation: .form-select styles the dropdown to match Bootstrap’s theme.

13.) Which Bootstrap class is used to create a textarea input field?

A) .form-textarea
B) .textarea-control
C) .form-control
D) .text-field

Answer: Option C

Explanation: The .form-control class is used for styling both <input> and <textarea> elements.

14.) How do you make a Bootstrap form input field required?

A) .form-required
B) required attribute
C) .mandatory
D) .validate-input

Answer: Option B

Explanation: The required attribute ensures the user cannot submit the form without filling in the input.

15.) Which Bootstrap class can be used to add an inline help message below an input field?

A) .form-help
B) .input-tooltip
C) .help-message
D) .form-text

Answer: Option D

Explanation: .form-text provides small descriptive text under an input field.

16.) Which Bootstrap class is used to display form validation messages?

A) .form-validation
B) .valid-feedback
C) .error-message
D) .form-error

Answer: Option B

Explanation: .valid-feedback shows validation messages when the input is correct.

17.) What Bootstrap class is used to make an input field required?

A) .form-required
B) .input-required
C) required attribute
D) .form-mandatory

Answer: Option C

Explanation: The required attribute ensures users must enter a value before submitting the form.

18.) How can you change the color of an input field’s border in Bootstrap?

A) .border-danger
B) .input-border-red
C) .form-control-danger
D) .border-color-red

Answer: Option A

Explanation: .border-danger applies a red border, indicating an error.

19.) What Bootstrap class adds a help text under an input field?

A) .input-help
B) .form-text
C) .form-tooltip
D) .help-text

Answer: Option B

Explanation: .form-text adds small help text below an input field.

20.) What class is used to create inline forms in Bootstrap?

A) .form-inline
B) .inline-form
C) .form-row
D) .form-group-inline

Answer: Option A

Explanation: .form-inline displays form elements side by side in one line.

Leave a Reply

Your email address will not be published. Required fields are marked *