Saturday, March 18, 2017

Passing second parameter from a second form?

I'm using laravel 5.4, my question is how can I pass a second parameter from a different form.

I know when I have multiple inputs in the same form I can pass multiple parameters

<form action="" method="get">
   <input type="text" name="country" placeholder="country">
   <input type="text" name="town" placeholder="town">
</form>

If I search here I would get something like website.com/?country=croatia&town=zagreb

but how can I get the same result but from two forms

<form action="" method="get">
   <input type="text" name="country" placeholder="country">
</form>

<form action="" method="get">
   <input type="text" name="town" placeholder="town">
</form>

I need to be able to search one form, and then the second if I want lets say I search for a country first and I get

website.com/?country=croatia

and now I want to search also for a town and I get

website.com/?country=croatia&town=zagreb

It should work the other way around!(If I search for a town first and the a country second. I know that this is a bad example)



via Bruno Erceg

Advertisement