Question

In: Computer Science

Is there a simple way to create a username and password for a registeration form? The...

Is there a simple way to create a username and password for a registeration form?

The username should be between 4 and 20 characters. The password should be between 4 and 12 characters, contain at least one digit, and contain at least one uppercase and one lowercase character. Select four special characters and require that the password contain at least one of them.

Solutions

Expert Solution

Step by step solution to create simple registration form given below,

HTML code:

<!DOCTYPE html>

<html>

<body>                        

<h1>Registration Form</h1>

<form>

Username:<input type="text" id="username" name="username" minlength="4" maxlength="20" required><br><br>

Password:<input type="password" id="password" name="password" required pattern="(?=.*\d)(?=.*[@$!?])(?=.*[a-z])(?=.*[A-Z]).{4,12}"   title="Must contain at least one number and one uppercase and lowercase and one special character from this list[@$!?], and length between 4 to 20"><br><br>

<input type="submit" value="Submit">

</form>

</body>

</html>

Attributes definition:

minlength - it specifies the minimum number of characters required in an input field.

maxlength - it specifies the maximum number of characters allowed in the <input> element

required - it specifies that an input field must be filled out before submitting the form

pattern - it specifies a regular expression that the <input> element's value is checked

title - The information is most often shown as a tooltip text when the mouse moves over the element

patterns explanation:

(?=.*\d) - At least one digit

(?=.*[@$!?]) - At least one special character

(?=.*[a-z]) - At least one lower case

(?=.*[A-Z]) - At least one Upper case

{4,12} - length between 4 to 12.

Output should be displaying like this,

sample 1:

sample 2:


Related Solutions

Python Coding 1. validate_username_password(username, password, users): This function checks if a given username and password matches...
Python Coding 1. validate_username_password(username, password, users): This function checks if a given username and password matches in the stored users dictionary. This function returns True if a match found otherwise returns False. 2. validate_existing_user(users): This function asks for username and password and checks if user provided name and password matches. It prints an informational message and returns username if it does find a match. Call validate_username_password() function to perform this validation. A user has total of three chances to validate....
Write C++ code that prompts the user for a username and password (strings), and it calls...
Write C++ code that prompts the user for a username and password (strings), and it calls the login() function with the username and password as arguments. You may assume that username and password have been declared elsewhere. Your code should print error messages if login() generates an exception: LoginException: "Username not found or password incorrect" ServerException: "The login server is busy and you cannot log in" AccessException: "Your account is forbidden from logging into this server" Any other exception: "Unknown...
Write C++ code that prompts the user for a username and password (strings), and it calls...
Write C++ code that prompts the user for a username and password (strings), and it calls the login() function with the username and password as arguments. You may assume that username and password have been declared elsewhere. Use virtual functions, pure virtual functions, templates, and exceptions wherever possible. Please explain the code. Your code should print error messages if login() generates an exception: LoginException: "Username not found or password incorrect" ServerException: "The login server is busy and you cannot log...
Q-1) a client wants to log into a server by using username and password first name...
Q-1) a client wants to log into a server by using username and password first name a suitable http mechanism like cookie or session to make it happen and then make a signal flow diagram to show that how does it happen
Please define the best practice to storage username / password authentication credentials and specify why? Hint:...
Please define the best practice to storage username / password authentication credentials and specify why? Hint: Since the username is public knowledge, the password storage can be based on.
The following times between keystrokes were recorded when a user typed the username and password: .23,...
The following times between keystrokes were recorded when a user typed the username and password: .23, .21, .27, .35, .33, .31, .34, .28, .20, .35, .31, .16, .16, .29, .39, .40, .35, .26 seconds. Let’s construct a 99% confidence interval for the mean time between keystrokes assuming Normal distribution of these times.
C++: Write a student class for the library, which have the following: Username, password, Maximum number...
C++: Write a student class for the library, which have the following: Username, password, Maximum number of copies that a student is allowed to keep(less than 5), maximum borrow periods(less than 30 days per book), list of copy(array) cpp and h
log in form Requirements: Form: There should be at least 2 input fields for username and...
log in form Requirements: Form: There should be at least 2 input fields for username and password. Use an array as a database in which there are several usernames and passwords: Usernames can be either emails or nick names (WITHOUT WHITE SPACE) After the user submitted the form, students must: sanitize the inputs check if there is a match with one username and one password in the array. If there is no match, print out an error message to user...
PLEASE ANSWER WASNT ANSWERED PYTHON You will ask 3 questions USERNAME = "user1" PASSWORD = "password1"...
PLEASE ANSWER WASNT ANSWERED PYTHON You will ask 3 questions USERNAME = "user1" PASSWORD = "password1" What is your user name? What is your password? What is your age? If the user name and password are incorrect, display a message that says - Your credentials are not valid If both user name and password are correct, ask question 3 If the answer to question 3 is eighteen and greater, display a message that says - You're considered an adult If...
Create a web page using PHP that allows the users to create an account (a username...
Create a web page using PHP that allows the users to create an account (a username and a password). There should be a login page that allows users to create an account by entering their preferred username and password. The same page should also let users login if they already have an account. If a user is logged in successfully , they should be able to enter a comment and also read the comments entered by others previously.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT