Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Template.task_form.events = () ->
- 'click #creation': () ->
- console.log("hello")
- hours = document.getElementById("task_hours").value * 60 * 60
- minutes = document.getElementById("task_minutes").value * 60
- seconds = document.getElementById("task_seconds").value
- Tasks.insert({title: document.getElementById("task_title").value, total: hours + minutes + seconds})
- <template name="task_form">
- <div id="task_from">
- <legend>Create Task</legend>
- <label>Title</label>
- <input id="task_title" type="text"/>
- <label>Hours</label>
- <input id="task_hours" type="text" value="0"/>
- <label>Minutes</label>
- <input id="task_minutes" type"text" value="0"/>
- <label>Seconds</label>
- <input id="task_seconds" type"text" value="0"/>
- <input type="button" id="creation" class="button btn-primary" value="Create"/>
- </div>
- </template>
Add Comment
Please, Sign In to add comment