Support the ongoing development of Laravel.io →
posted 11 years ago
Blade Forms

Patience folks, I'm a noob. We know that the Form::submit simply submits the form using the form's action. The documentation (that I'm finding anyway) says that the Form::button syntax is exactly the same as the submit button ... but how do we tell it what action to take?? I'm amazed that I don't find this anywhere and have to think it's so simple it goes without asking. Normally ;-)

Last updated 3 years ago.
0

What do you mean by "action"? You might be confused as to what a regular html <button></button> element does. If it's in the <form>, then it'll submit the form. Just like with normal HTML, you specify the form action in the form element, not on the button.

On the other hand, if you use a <button> outside a form, it does nothing natively, no matter your back-end framework. This is good, because it allows you to bind it to events using javascript (without having to prevent default browser action like you would with <a href="#">) --- laravel or not, this is what's done with the non-form <button> on websites: You need to bind some JS.

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

rob1grie rob1grie Joined 10 Mar 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.