1234567891011121314151617181920212223242526 |
- /**
- * Client code for the website_form template.
- *
- * - events
- */
- Template.website_form.events({
- "click .js-toggle-website-form": function () {
- $("#website_form").toggle("slow");
- },
- "submit .js-save-website-form": function (event) {
- // here is an example of how to get the url out of the form:
- const url = event.target.url.value;
- const title = event.target.title.value;
- const description = event.target.description.value;
- // put your website saving code in here!
- const doc = { url, title, description };
- Meteor._debug("Client trying to insert", doc);
- Websites.insert(doc);
- // Stop the form submit from reloading the page
- return false;
- }
- });
|