subject

In this exercise we are going to practice validating a password to confirm it contains letters and numbers using simple regular expressins. This exercise uses if statements to find a valid password instead of finding an invalid one. Inside the if statement that is already in the checkPassword(e) function: Create 2 variables, reA and reB. Assign one of the variables the regular expression for a number, assign the other the regular expression that will match any uppercase or lowercase letter. Place your regular expressions between //. Unlike the examples in lecture, you do not want to use ^ at the start of your regular expression or the $ at the end because that requires that you match ALL characters in the string instead of just looking for one. Create a second if statement (nested inside the first if statement) that checks if the password matches both regular expression variables: Call the test method on reA and pass it the value of the password entered in the pwd input. Call the test method on reB and pass it the value of the password entered in the pwd input. Note: Use a single if statement that checks that both of these validation conditions are true. Inside the body of the nested (inner) if statement: Set the disabled property of the submit variable to true (because the element passed validation). return true

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:10
Assume that minutes is an int variable whose value is 0 or positive. write an expression whose value is "undercooked" or "soft-boiled" or "medium-boiled" or "hard-boiled" or "overcooked" based on the value of minutes. in particular: if the value of minutes is less than 2 the expression's value is "undercooked"; 2-4 would be a "soft-boiled", 5-7 would be "medium-boiled", 8-11 would be "hard-boiled" and 12 or more would be a "overcooked".
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
Which option allows you to view slides on the full computer screen?
Answers: 1
question
Computers and Technology, 23.06.2019 08:00
The managing director of a company sends a christmas greeting to all his employees through the company email. which type of network does he use? he uses an .
Answers: 3
question
Computers and Technology, 23.06.2019 21:20
In microsoft word, when you highlight existing text you want to replace, you're in              a.  advanced mode.    b.  automatic mode.    c.  basic mode.    d.  typeover mode
Answers: 1
You know the right answer?
In this exercise we are going to practice validating a password to confirm it contains letters and n...
Questions
question
English, 22.06.2021 18:30
question
Mathematics, 22.06.2021 18:30
question
Mathematics, 22.06.2021 18:30
question
Advanced Placement (AP), 22.06.2021 18:30