JoHksi
JoHksi

Reputation: 517

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">
</form>

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

Upvotes: 0

Views: 111

Answers (1)

Paresh Gami
Paresh Gami

Reputation: 4782

Just use a tag for that like below

<a href="" class="button button-form-success button--primary vertical-offset--small">Second Button</a>

Upvotes: 1

Related Questions