I am reproducing a simplified version of my problem, to ask a fundamental question.
I have a template called 'form',
<template name="form">
<input id="name" type="text">
<button id="submitform type="submit">Submit</button>
</template>
I am handling the submit event as follows,
Template.form.events({
'click #submitform': function() {
event.preventDefault();
if(Meteor.user())
alert('submitted');
else{
//save the filled form along with view (basically the template or view)
Router.go('login');
}
}
});
My question is, how do i save the filled template with data filled in a variable/any how, so that i can render it after sign in. This is how I am rendering to form template,
Router.route('/form', function () {
this.render('form');
});
What I want is to be able to render the user filled template/view back for him when he signs in. Please tell if there is a meteor way of doing it, and not easy JavaScript hack. Please ask if you need additional data/code. Thanks in advance.