Hello! I’m trying to figure out why my submit form helper no longer works after the Meteor update. I have a modal that allows users to update fields then submit and the helper no longer triggers from the submit button.
HTML:
<template name="editModal">
<div class="modal fade" id="editModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">×</span>
<span class="sr-only">Close</span>
</button>
<h4 class="modal-title">Edit This Marker</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" role="form">
<div class="form-group">
<label class="col-sm-2 control-label" for="title">Title</label>
<div class="col-sm-10">
<input name="title" id="title" type="text" value="{{title}}" placeholder="Marker Title" class="form-control" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="markerInfo">Information</label>
<div class="col-sm-10">
<textarea name="markerInfo" class="form-control" id="markerInfo" type="text" value="{{markerInfo}}" placeholder="What is this?" rows="3"></textarea>
</div>
</div>
<div class="modal-footer">
<input type="submit" value="Submit" class="btn btn-primary submit" id="save" data-dismiss="modal">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
</div>
</form>
</div>
</div>
</div>
</div>
</template>
JS:
Template.editModal.events({
'submit form': function (e) {
e.preventDefault();
var currentMarkerId = infoWindowMarker._id;
var markerProperties = {
title: $(e.target).find('[name=title]').val(),
markerInfo: $(e.target).find('[name=markerInfo]').val()
}
console.log(markerProperties);
Markers.update(currentMarkerId, {$set: markerProperties}, function (error) {
if (error) {
// display the error to the user
alert(error.reason);
}
});
}
});