Reputation: 138
I have a date variable in session that I have displayed on a template via template.helper and displays fine. I have forms via autoform package that I am using and the forms display and submit/insert/update values correctly.
I am trying to insert the value of one field via spacebar and its not working; as in, the form displays correctly in the template but the value does not display. I've used it without quotes and single instead of doublequotes and with triple handlebars. It seems that autoform does not work with nested spacebars? What am I missing here? Is there an alternative?
{{> afQuickField name='date' value="{{modalDateEditing}}" }}
Upvotes: 0
Views: 66
Reputation: 138
Ok, answered my own question through some more research. One doesnt need spacebars.
calModal.html....
{{#autoForm collection="CalEvents" id="edit-form" type="insert" schema=calevent}}
{{> afQuickField name='date' value=dateInsert}}
<div><button type="submit">Submit</button></div>
{{/autoForm}}`
calModal.js.....
Template._calModal.helpers({
dateInsert: function(){
var modalDateEditing = Session.get('DateEditing');
return modalDateEditing;
}
});
Thanks to this post:
How to pass a default value for a field in 'insert' form?
Upvotes: 0