…but then realized that in this case the Submit button is not inside a Template, so I can’t use Template.Bla.events() to respond to the Submission of the form.
I second nxcong, Template.body.events is built into meteor. And also consider using this package:
You end up writing code like this, IMO nicer than jquery imperative selectors:
// template
<input type="submit" value="Submit" onclick="{{submitGargantuanForm}}">
// js
Template.body.events({
submitGargantuanForm: function (event, templateInstance) {
console.log('submit button was clicked');
}
});
If you’re using Session to store everything then that’s great. Otherwise, you’re going to have a bit of an issue with getting all that nested template info back into the parent for the submission I’d imagine…
Beautiful, thanks.
After 20+ years of coding, from Pascal to Delphi to C# to the “web trilogy” of HTML, CSS, and JavaScript/jQuery, Meteor has gotten my excited about programming again – or more specifically, making things (with software). - Clay Shannon