I'm a beginner with parse and jquery. But for some reason I'm having issues with the most basic thing, which is outputting messages into the console. I've checked my Chrome settings and they're are filtering to all.
I've written the code to simply store email and password FE inputs into parse. If the inputs match the basic validation that I've created, it should display a console message. If the input is invalid, it should display another console message. But for some reason everything I've tried doesn't seem to be working. Here is what my code looks like. https://i.sstatic.net/S42dg.jpg
Thanks for the help. Please let me know if I've left out any information.
index.html
<div class="modal fade" id="signUp" tabindex="-1" role="dialog" aria-labelledby="signUpLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="signUp-title" id="signUpLabel">Sign Up</h4> </div> <div class="modal-body"> <form id = "register-form"> <div class="form-group"> <label for="exampleInputEmail1">Email address</label> <input type="email" class="form-control" id="exampleInputEmail1" placeholder="Email"> </div> <div class="form-group"> <label for="password">Password</label> <input type="password" class="form-control" id="password" placeholder="Password"> </div> <div class="form-group"> <label for="password2">Confirm Password</label> <input type="password" class="form-control" id="password2" placeholder="Confirm Password"> </div> </form> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary">Sign Up</button> </div> </div> </div> </div>
jquery.js
Parse.initialize("xxx", "yyy");
$("#register-form").submit(function(event){ event.preventDefault(); //lets page prevent refresh
var email = $("#exampleInputEmail1"). val(); var password = $("#password"). val(); var password2 = $("#password2"). val();
if ( password == password2) { var user = new Parse.User(); user.set("email", email) user.set("password", password)
user.signUp(null, {success:function(user){ console.log("Register Succeeded!") }, error:function(user, error){ console.log("Registration error:" +error.message); } });}
});