A
A
Abc Edc2015-08-04 23:23:40
JavaScript
Abc Edc, 2015-08-04 23:23:40

How to get rid of dirty url in Multiple check?

Displaying a list of types
This filter helps to get a list depending on the selected types. It is assumed that the user non-stop clicks on them. The form is submitted on the server to an array of checked types $request->input('types') the type is received (added or removed) and the sheet is returned along with the array so that each time checked="checked" is (well, the user chose what he chose there)

@foreach($types as $type)
                <div class="checkbox">
                    <label>
                        <input onclick="submit()"  name="company_types[]" type="checkbox" value="{{$type->id}}">{{$type->name}}
                    </label>
                </div>
            @endforeach

the problem is that the address bar looks something like this
company_types%5B%5D=1&company_types%5B%5D=2&company_types%5B%5D=3&company_types%5B%5D=5&company_types%5B%5D=6&company_types%5B%5D=7&company_types%5B%5D=8&company_types%5B%5D=9&company_types%5B%5D=10&company_types%5B%5D=11&company_types%5B%5D=12&company_types%5B%5D=13&company_types%5B%5D=14

Maybe I chose the wrong solution? and maybe somehow fix it in two fingers in Laravel, tell me please! I know what you tell me to use the POST method. But is it right to use a post for this? Not to mention that in order to give a link to the minted parameters, you will need to write this with a separate pars method (

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2015-08-04
@gleber1

Naturally, the most obvious post.
But if you want perversions (this is just purely an implementation possibility, you should not take it as good solutions):
1) you can write to cookies and read on the server
2) you can find a common value (if there are not so many fixed parameters)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question