JoHksi JoHksi - 2 years ago 81
AngularJS Question

Inserting a button inside a form and triggering different actions in an Angular app

I'm making a web app. I'm in the middle of implementing the Braintree and everything works fine. Now I have an issue with the view code for Braintree. Below is an essential view code I need for braintree integration:

<form name="form" ng-submit="submitPayment()">
<div id="payment-form"></div>
<input type="submit" class="button button-form-success button--primary vertical-offset--small" value="Pay">

Now, I am trying to add another button next to
button, but whenever I put the button in the form, it triggers
instead of button's action. How do I successfully add a button inside the form and trigger different function when clicked?

Answer Source

Just use a tag for that like below

<a href="" class="button button-form-success button--primary vertical-offset--small">Second Button</a>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download