Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. <template name="thingform">
  2. <div class="container">
  3. <div class="row">
  4.  
  5. <!-- Project Name Form-->
  6. <form class="col s6">
  7. <div class="input-field col s6">
  8. <input placeholder="{{projectDoc}}" name="tname" type="text" class="validate">
  9. <label>Thing Name</label>
  10. </div>
  11.  
  12. <button id="yoid" class="btn waves-effect waves-light tbutton" type="submit">
  13. <i class="material-icons right">Submit</i>
  14. </button>
  15. </form>
  16. </div>
  17. </div>
  18.  
  19. Template.thingform.helpers({
  20. projectDoc: function() {
  21. return "Hello";
  22. }
  23. });
  24.  
  25. Template.thingform.events({
  26. "click .tbutton": function(e) {
  27. var bid = e.target.id;
  28. e.preventDefault();
  29. console.log(bid);
  30. }
  31. });
  32.  
  33. var bid = $(e.target).prop("id");
  34.  
  35. var bid = $(e.target).attr("id");
  36.  
  37. var bid = event.currentTarget.id;
  38.  
  39. <!-- Project Name Form-->
  40. <form class="col s6">
  41. <div class="input-field col s6">
  42. <input placeholder="{{projectDoc}}" name="tname" type="text" class="validate">
  43. <label>Thing Name</label>
  44. </div>
  45.  
  46. <button id="yoid" class="btn waves-effect waves-light tbutton" type="submit">
  47. <i class="material-icons right">Submit</i>
  48. </button>
  49. </form>
  50.  
  51. "click .tbutton": function(e) {
  52. var bid = e.currentTarget.id;
  53. e.preventDefault();
  54. console.log(bid); // Logs 'yoid'
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement