Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions validator.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,35 @@

//insert your code here


$(function(){
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Say a user entered an invalid username &/or password. Would this form still submit data to the server?

var email_error = $("li:nth-child(1)")
var pw_8ch_error = $("li:nth-child(2)")
var pw_cap_error = $("li:nth-child(3)")
var pw_num_error = $("li:nth-child(4)")
email_error.hide();
pw_8ch_error.hide();
pw_cap_error.hide();
pw_num_error.hide();


var email = $("input[type='text']").val()
var password = $("input[type='password']")
var submit = $("input[type='submit']")

var capPassword = $("input[type='password']")

var emailValidation = /^([\w.-]+)@([\w.-]+)\.([a-zA-Z.]{2,6})$/i


submit.click(function(){
if (email.match(emailValidation)) {
} else {
email_error.show()
}

if ((password.length) < 8 ){
pw_8ch_error.show()
}

//insert your code here
})
});