Hi! I’m a beginner using Meteor and iron:router for my web app. I am currently having an issue where after a user registers the page is supposed to redirection to a different page but never does. I was going by the below tutorial and I don’t think I had any significant deviations so I’m not sure what’s going wrong. Thanks in advance!
tutorial: http://meteortips.com/second-meteor-tutorial/user-accounts/
Template.register.events({
'submit form': function(event){
event.preventDefault();
var email = $('[name=email]').val();
var password = $('[name=password]').val();
Accounts.createUser({
email: email,
password: password
});
Router.go('home');
}
});
<template name="register">
<h2>Register</h2>
<form class="register">
<p>Email: <input type="email" name="email"></p>
<p>Password: <input type="password" name="password"></p>
<p><input type="submit" value="Register"></p>
</form>
</template>
Right now what happens when I click submit is that the button looks like its pressed but the page doesn’t change and nothing else happens.