Hi all,
I have encounter this difficulty of not being able to trigger the button “click” event with all the ways I can think of.
The following is my html:
<form id="login-form"> ... <button class="btn btn-primary" type="submit">Log In</button> <button class="btn btn-link" type="button" id="forgot-password">Forgot Password</button> </form>
And my client side javascript:
Template.signupForm.events({
‘submit #signup-form’: function(event, template){
…
},
‘click #forgot-password’:function(){
event.preventDefault();
…
}
});
The submit event works fine but not the “forgot password” button. I have also tried changing the id attribute of the button to value attribute and query the value in event selector but I am getting no luck.
Does anyone know the solution to this?
Thanks in advance.