dimanche 28 décembre 2014

MeteorJS email form validation


Total novice here. I'm trying to do a client side form validation for a subscribe to newsletter form. My client side code is such.



Template.body.events({
"submit .new-subscriber": function (event) {
// This function is called when the new task form is submitted
var newEmail = event.target.newEmail.value;
if (newEmail is email?){

Meteor.call("addNewSubscriber", newEmail);
}


I'm not sure how to perform form validation here? Can I perform the same server side?





Aucun commentaire:

Enregistrer un commentaire