Skip to content

Commit

Permalink
Resolved Signup error codeforamerica#229
Browse files Browse the repository at this point in the history
Added validation for Email, Password, Name on Sign Up Page.
Now unless all three fields are added, User cannot sign up.
  • Loading branch information
vipulkanade committed Apr 11, 2015
1 parent 828f3e3 commit fdf26d0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion js/BfUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,21 @@ var BfUser = (function (BfUser) {
// Send sign up info to server on signup click.
function _signUpClicked(event){
if (config.debug) console.log("Submitting signup info.")
newUser = {
if ($('#name').val() === "") {
alert("Enter Name");
} else if ($('#email').val() === "") {
alert("Enter Email");
} else if ($('#password').val() === "") {
alert("Enter Password");
} else {
newUser = {
name : $('#name').val(),
email : $('#email').val(),
password : $('#password').val()
}
if (config.debug) console.log(JSON.stringify(newUser));
$.post(config.bfUrl + '/signup', newUser, _signedUp).fail(_badPost);
}
}

// Send sign in info to server on signin click.
Expand Down

0 comments on commit fdf26d0

Please sign in to comment.