Reputation: 13
I have attempted to create a sign in using parse but when I attemp to hit the submit button, there is no response. I do not know what I should do next. The source of confusion is under "register-form". Thanks for any help you give. Also I used the web app section of parse for my site.
<!DOCTYPE html>
<html>
<head>
<link type="text/css" rel="stylesheet" href="stylesheet.css">
<script src="bower_components/jquery/dist/jquery.js" charset="utf-8"></script>
<script src="bower_components/parse/parse.js"> </script>
<script> Parse.initialize("9gnbNsFoQShUFWP0dp96S771Y2oxxuRd8gDdcfe9", "sgBmpwSykCv2Z9qALJj8KgEMP34ILuEFhLRJWkau"); </script>
<!-- Include Parse! -->
</head>
<body>
<div class="nav">
<div class="container">
<ul>
<a href="page3.html">Schedule</a>
<a href="page2.html">Forums</a>
<a href="page4.html">Sign Up</a>
<a href="page5.html">Log In</a>
<a href="index.html">Home</a>
</ul>
<div class="heading">
<center>
<h1>
<center><img src="https://upload.wikimedia.org/wikipedia/en/thumb/3/30/Winchester_Thurston_School_Logo.svg/220px-Winchester_Thurston_School_Logo.svg.png"
alt="Smiley face" style="float:left;width:42px;height:42px;"></center>
Winchester Thurston </h1></center>
</div>
</div>
</div>
</div>
<div class="right">
<p> News will go here </p>
</div>
<form id="register-form" autocomplete="on">
<h1> Sign up </h1>
<p>
<label for="usernamesignup" class="uname" data-icon="u">Username(School Appropriate):</label>
<input id="usernamesignup" name="usernamesignup" required="required" type="text" placeholder="Username" />
</p>
<p>
<label for="passwordsignup" class="youpasswd" data-icon="p">Password:</label>
<input id="passwordsignup" name="passwordsignup" required="required" type="password" placeholder="Password" />
</p>
<p>
<label for="emailsignup" class="youmail" data-icon="e">Email(Use WT emal):</label>
<input id="emailsignup" name="emailsignup" required="required" type="email" placeholder="[email protected]" />
</p>
<p class="signin button">
<input class="register-submit" type="submit" value="Register" />
<script>
$(function() {
var registerForm = $('#register-form');
registerForm.on('submit', function(ev) {
ev.preventDefault();
// Pull fields from the form.
window.form = registerForm;
// Do parse stuff.
var user = new Parse.User();
user.set("username", registerForm.find('#usernamesignup').val());
user.set("password", registerForm.find('#passwordsignup').val());
user.set("email", registerForm.find('#emailsignup').val());
/*
user.set("password", "my pass");
user.set("email", "[email protected]");
*/
// FINISH IT.
});
});
</script>
</p>
</form>
</div>
</div>
<div class="footer">
I made this and don't steal it
</div>
</body>
</html>
Upvotes: 1
Views: 54
Reputation: 71
As from Parse documentation, you might be missing signUp after set
user.set("username", registerForm.find('#usernamesignup').val());
user.set("password", registerForm.find('#passwordsignup').val());
user.set("email", registerForm.find('#emailsignup').val());
user.signUp(null, {
success: function(user) {
// Hooray! Let them use the app now.
},
error: function(user, error) {
// Show the error message somewhere and let the user try again.
alert("Error: " + error.code + " " + error.message);
}
});
Upvotes: 1