Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <template name="thingform">
- <div class="container">
- <div class="row">
- <!-- Project Name Form-->
- <form class="col s6">
- <div class="input-field col s6">
- <input placeholder="{{projectDoc}}" name="tname" type="text" class="validate">
- <label>Thing Name</label>
- </div>
- <button id="yoid" class="btn waves-effect waves-light tbutton" type="submit">
- <i class="material-icons right">Submit</i>
- </button>
- </form>
- </div>
- </div>
- Template.thingform.helpers({
- projectDoc: function() {
- return "Hello";
- }
- });
- Template.thingform.events({
- "click .tbutton": function(e) {
- var bid = e.target.id;
- e.preventDefault();
- console.log(bid);
- }
- });
- var bid = $(e.target).prop("id");
- var bid = $(e.target).attr("id");
- var bid = event.currentTarget.id;
- <!-- Project Name Form-->
- <form class="col s6">
- <div class="input-field col s6">
- <input placeholder="{{projectDoc}}" name="tname" type="text" class="validate">
- <label>Thing Name</label>
- </div>
- <button id="yoid" class="btn waves-effect waves-light tbutton" type="submit">
- <i class="material-icons right">Submit</i>
- </button>
- </form>
- "click .tbutton": function(e) {
- var bid = e.currentTarget.id;
- e.preventDefault();
- console.log(bid); // Logs 'yoid'
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement