Support the ongoing development of Laravel.io →
Requests Views Forms

I have a simple form which allows the User to enter from_date and to_date.Lets say a user enters 2014-09-01 and 2014-09-10 respectively. How can I get this form submit to a URL: ../from_date/2014-09-01/to_date/2014-09-10

Last updated 2 years ago.
0

I don't know why you would do it like this (this is very stupid imo) but you'll have to use some Javascript)

Laravel: Routes & Controller

Route::post('from_date/{fromdate}/to_date/{todate}', 'SomeController@method');

protected function method($fromdate, $todate) {
    // Logic
}

Then you'll need to read the input from user with Javascript before submitting, then modify the form's action attribute and finally submit it.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

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.