Separate javascript from html file
This commit is contained in:
		
							parent
							
								
									75a581386e
								
							
						
					
					
						commit
						c2194a4c0a
					
				
					 2 changed files with 13 additions and 14 deletions
				
			
		|  | @ -18,18 +18,5 @@ | ||||||
|     <a class="nav-link" href="index.html">Return to main menu</a> |     <a class="nav-link" href="index.html">Return to main menu</a> | ||||||
| </form> | </form> | ||||||
| </body> | </body> | ||||||
| <script type = "text/JavaScript"> | <script type = "text/JavaScript" src="signupPage.js"></script> | ||||||
|     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> | ||||||
							
								
								
									
										12
									
								
								front/static/signupPage.js
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								front/static/signupPage.js
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,12 @@ | ||||||
|  | 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; | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Jack
						Jack