You could add a name and value attribute to the button:
<button name="someButton" value="SomeValue">Button</button>
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" />
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.
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>
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?
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.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community