error if sign up form is empty

This commit is contained in:
Sacha Greif 2012-12-07 09:31:38 +09:00
parent f6fb8372b9
commit e1246e0d13
2 changed files with 6 additions and 0 deletions

View file

@ -4,6 +4,10 @@ Template.user_signup.events = {
var username = $('#username').val();
var email = $('#email').val();
var password = $('#password').val();
if(!username || !email || !password){
throwError('Please fill in all fields');
return false;
}
Accounts.createUser({
username: username
, email: email

View file

@ -17,6 +17,8 @@ var updateScore = function (collection, id) {
if(object.sticky)
newScore=999;
collection.update(id, {$set: {score: newScore}});
// console.log('old score: '+object.baseScore+' | new score: '+newScore+' | score diff: '+Math.abs(newScore-object.baseScore));
};
Meteor.startup(function () {