Support the ongoing development of Laravel.io →
Requests Input Forms
Last updated 2 years ago.
0

You could add a name and value attribute to the button:

<button name="someButton" value="SomeValue">Button</button>

Last updated 2 years ago.
0

Doing what @JordanDalton recommended would be a good idea, however you could also do a hidden form element.

Form::hidden('action', 'edit')

<input type="hidden" name="action" value="edit" />
Last updated 2 years ago.
0

ok thanks!

but why isnt this working?

Last updated 2 years ago.
0

Laravel doesn't submit the "submit" button data. This is expected. If you do a datadump of all data included in the input it doesn't come back with it.

echo "<pre>";
dd(Input::all());

You can see all the data that is included with the form submission.

Last updated 2 years ago.
0

If you use

<input type="submit" name="edit"  value="Bearbeiten" />

instead of

<button type="submit">Bearbeiten</button>

you would get edit=Bearbeiten in the URI as well as in Input::get()

PS: If you however need to insert HTML content inside <button></button>, then you would do as @JordanDalton said, or maybe an A tag is more suitable?

<form action="/test" name="foo" method="get">
    <input type="hidden" name="edit" value='bar' />
    <button type="submit">Submit Text or Image</button>
</form>
Last updated 2 years ago.
0

AbbyLynn said:

Laravel doesn't submit the "submit" button data. This is expected. If you do a datadump of all data included in the input it doesn't come back with it.

echo "<pre>";
dd(Input::all());

You can see all the data that is included with the form submission.

Thanks a bunch, its working now, but just for my understandig: it makes sense what you wrote, but why is it showing me edit in the URI?

Last updated 2 years ago.
0

gilganebu said:

AbbyLynn said:

Laravel doesn't submit the "submit" button data. This is expected. If you do a datadump of all data included in the input it doesn't come back with it.

echo "<pre>";
dd(Input::all());

You can see all the data that is included with the form submission.

Thanks a bunch, its working now, but just for my understandig: it makes sense what you wrote, but why is it showing me edit in the URI?

Because you are using GET in your form.

See: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

gilganebu gilganebu Joined 14 Jul 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.

© 2024 Laravel.io - All rights reserved.