How to include a button within a form that does not act as the Submit button

user1072337

I have a form that I would like a user to fill out with some basic information. However, before submitting the info, I want to include a button I am using to activate Stripe to request payment.

I have tried this so far, however, this button before the submission button is acting as the submit button.

Here is some code:

{{ Form::open(array('route' => 'fans.store')) }}

{{ Form::label('name', 'Name:') }}
{{ Form::text('name', null, array(
        'class'     => 'input',
        ));}}

{{ Form::label('email', 'Email:') }}
{{ Form::text('email', null, array(
        'class'     => 'input',
        ));}}

<div class="button_row">
<button id="customButton" class="button">Purchase</button>
</div>

<div class="button_row">
{{Form::submit('Submit', ['class' => 'button'])}}
</div>

{{Form::close()}}

Any work arounds? The syntax is blade php (I'm using Laravel 4). Thank you.

user919426

Try the following:

{{ Form::button('purchase', 'Purchase with Stripe', array( 'id' => 'purchase', 'onclick'=>'myFunction()')) }}

That creates a purchase button,

  1. labeled "Purchase with Stripe"
  2. Calls myFunction() that launches stripe

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to give a HTML "A" tag act as a submit button

From Dev

How to give a HTML "A" tag act as a submit button

From Dev

how to block form submit button

From Dev

How to click submit button in a form?

From Dev

Submit button does not work within popup window

From Dev

How to submit a form by clicking submit button only

From Dev

Why does my form not submit when the submit button is named "submit"?

From Dev

How to handle form submit button when submit button has no name

From Dev

Rails form_for submit button does nothing

From Dev

How to include "span" and "class" with submit button?

From Dev

Submit a form with keypress on submit button, does it trigger onclick?

From Dev

how to submit form name and submit button name in ajax form submission

From Dev

Rails: How to style form submit button

From Dev

How to prevent form submit when a button clicked?

From Dev

How to get onclick working with form submit button?

From Dev

How to save a form on button submit in php

From Dev

How to prevent that a JQuery button submit my form?

From Dev

How to prevent form submit when a button clicked?

From Dev

How to get onclick working with form submit button?

From Dev

How to disable submit button when form is empty

From Dev

How to automatically submit button once form load

From Dev

How to hide form on submit button in shiny?

From Dev

How to disable the submit button outside the form

From Dev

Submit form with no submit button in rvest

From Dev

Bookmarking a form submit button

From Dev

submit button in the middle of form

From Dev

Submit a form with a button (HTML)

From Dev

Styling a button in the Form::submit

From Dev

submit form: button or input?

Related Related

HotTag

Archive