How can you correctly pre-populate a select control with the current value from the template?
I have a simple form to edit a record where the values for the selected
I used the following in my project (in case someone needs it :)
and
Template.editApplicant.helpers({
selectedMaritalStatus: function(key){
return key == this.maritalStatus ? 'selected' : '';
}
});
"this.maritalStatus" gets the Marital Status from the current document (Applicant).
Use the following code, to save the value in the database
maritalStatus: $('#maritalStatusList').val()
Thanks for you all..