Create webpage with text input boxes for username and password and a second password verification box for creating a user account. Secondary password box should verify that the passwords match. Each text for now should be at least 4 characters long
This commit is contained in:
		
							parent
							
								
									7b62d5c261
								
							
						
					
					
						commit
						75a581386e
					
				
					 1 changed files with 24 additions and 0 deletions
				
			
		|  | @ -8,4 +8,28 @@ | ||||||
|     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> |     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | ||||||
|     <title>Sign up</title> |     <title>Sign up</title> | ||||||
| </head> | </head> | ||||||
|  | <body> | ||||||
|  | <h1>Sign up page</h1> | ||||||
|  | <form id="signup"> | ||||||
|  |     User Name: <input type="text" id="userName" minlength="4" size="10" required="required"><br> | ||||||
|  |     Password: <input type="password" id="password" minlength="4" size="10" required="required"><br> | ||||||
|  |     Confirm Password: <input type="password" id="confirmPassword"><br> | ||||||
|  |     <input type="submit" value="Submit" formaction="index.html"> | ||||||
|  |     <a class="nav-link" href="index.html">Return to main menu</a> | ||||||
|  | </form> | ||||||
|  | </body> | ||||||
|  | <script type = "text/JavaScript"> | ||||||
|  |     var password = document.getElementById("password"); | ||||||
|  |     var confirm_password = document.getElementById("confirmPassword"); | ||||||
|  |     function validatePassword(){ | ||||||
|  |         if(password.value != confirm_password.value) { | ||||||
|  |             confirm_password.setCustomValidity("Passwords Don't Match"); | ||||||
|  |         } | ||||||
|  |         else { | ||||||
|  |             confirm_password.setCustomValidity(''); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |     password.onchange = validatePassword; | ||||||
|  |     confirm_password.onkeyup = validatePassword; | ||||||
|  | </script> | ||||||
| </html> | </html> | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Jack
						Jack