Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The jQuery features for forms and controls let you do all but one of the following. Which one is it? Question 1 options: a) set

The jQuery features for forms and controls let you do all but one of the following. Which one is it?

Question 1 options:

a)

set the values of error messages

b)

get the value in a text box

c)

select the check boxes that are checked

d)

validate specific types of entries in text boxes

Question 2 (10 points)

You can use an event handler for the submit event of a form to validate the data on the form when the user clicks a ________________ button.

Question 2 options:

Question 3 (10 points)

To use the validation plugin, you code the validate method

Question 3 options:

a)

within the click event handler of a submit button

b)

within the click event handler of a regular button

c)

of the submit button for a form

d)

of the form

Question 4 (10 points)

Which of the following HTML5 attributes is used for data validation?

Question 4 options:

a)

placeholder

b)

action

c)

pattern

d)

autofocus

Question 5 (10 points)

Which of the following coding sequences can be used to validate the data on a form and submit it to the server?

Question 5 options:

a)

Within the click event handler of a regular button, validate the data and then issue the submit method of the form if the data is valid or the preventDefault method if it isnt.

b)

Within the click event handler of a regular button, validate the data and then issue the submit method of the form if the data is valid.

c)

Within the click event handler of a submit button, validate the data and then issue the submit method of the form if the data is valid

d)

Within the click event handler of a submit button, validate the data and then issue the submit method of the form if the data is valid or the preventDefault method if it isnt.

Question 6 (10 points)

Code example 8-2 $("#member_form").validate({ rules: { password: { required: true, minlength: 6 }, verify: { required: true, equalTo: "#password" } } });

(Refer to code example 8-2) What do password and verify refer to in this code?

Question 6 options:

a)

The type of element to be validated

b)

The type attribute of the field to be validated

c)

The name attribute of the field to be validated

d)

The id attribute of the field to be validated

Question 7 (10 points)

Code example 8-1 $(document).ready(function() { $(":text, :password").after("*"); . . $("#member_form").submit( function(event) { var isValid = true; . . var password = $("#password").val(); if (password == "") { $("#password").next().text("This field is required."); isValid = false; } else if ( password.length < 6) { $("#password").next().text("Must be 6 or more characters."); isValid = false; } else { $("#password").next().text(""); } . . } ); });

(Refer to code example 8-1) What does the first statement in the ready function do?

Question 7 options:

a)

Add an asterisk after all text and password elements that follow a span element

b)

Add a span element with a value of * after all input elements with a type of text or password

c)

Add a span element with a value of * after all text or password elements

d)

Add an asterisk after all input elements with a type of text or password

Question 8 (10 points)

Code example 8-1 $(document).ready(function() { $(":text, :password").after("*"); . . $("#member_form").submit( function(event) { var isValid = true; . . var password = $("#password").val(); if (password == "") { $("#password").next().text("This field is required."); isValid = false; } else if ( password.length < 6) { $("#password").next().text("Must be 6 or more characters."); isValid = false; } else { $("#password").next().text(""); } . . } ); });

(Refer to code example 8-1) Which of the following doesnt the if statement in this example do?

Question 8 options:

a)

Check that the field with an id of password contains an entry

b)

Check that the field with an id of password contains a value that has 6 or more characters

c)

Cancel the submission of the form if the the entry for the password field is invalid

d)

Display an error message if the entry for the password field is invalid

Question 9 (10 points)

Code example 8-2 $("#member_form").validate({ rules: { password: { required: true, minlength: 6 }, verify: { required: true, equalTo: "#password" } } });

(Refer to code example 8-2) The password and verify fields will be valid when

Question 9 options:

a)

the values of the two fields are equal and contain at least 6 characters

b)

the values of the two fields are equal

c)

values are entered into both fields, the password field contains at least 6 characters, and the verify field contains the value #password

d)

values are entered into both fields and the password field contains at least 6 characters

Question 10 (10 points)

When you use the validation plugin, you can specify the validation ________________ and the error messages that should be used for each field.

Question 10 options:

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Distinguish between formal and informal reports.

Answered: 1 week ago