11.08.2017 Views

codebright

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Forms 166<br />

1 <br />

2<br />

3 <br />

6 <br />

8 <br />

9 <br />

Form Buttons<br />

Our forms are no good if we can’t submit them. Let’s have a close look at the buttons that we have<br />

available to us.<br />

Submit Button<br />

First up is the submit button. There’s nothing quite like a classic! Here’s how it looks.<br />

1 <br />

2<br />

3 {{ Form::open(array('url' => 'my/route')) }}<br />

4 {{ Form::submit('Save') }}<br />

5 {{ Form::close() }}<br />

The first parameter to the Form::submit() is the value, which in the case of a button is the label used<br />

to identify the button. As with all of the input generation methods, the button generation methods<br />

will accept an optional last parameter to provide additional attributes.<br />

Here’s the generated HTML source code from the above example.<br />

1 <br />

2<br />

3 <br />

6 <br />

8 <br />

9 <br />

Great! We can now submit our forms. Let’s have another look at an alternative form of button.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!