Creating a Reset Input Field

Problem

You want to create a reset button in your Blade template.

Solution

Use the Form::reset() method.

You only need to supply the value as the first argument.

{{ Form::reset('Clear form') }}

The HTML produced is.

<input type="reset" value="Clear form">

If you want to add additional attributes, add a second argument with an array of attributes.

{{ Form::reset('Clear form', ['class' => 'form-button']) }}

Now the output has a class attribute.

<input class="form-button" type="reset" value="Clear form">

Discussion

Nothing to discuss.

comments powered by Disqus