<input type="hidden" name="_type" value="on"> generated with <input type="checkbox"> on runtime

474 Views Asked by At

I have been creating a form with lots of <input type="checkbox"> for search and filter functionality. Please find the code below;

    <div class="custom-control custom-checkbox">
        <input type="checkbox" class="custom-control-input" name="type" value="1" id="type1">
        <label class="custom-control-label" for="type1">Filter Sub Item</label>
   </div>

But when the page renders in the browser the DOM is appended with a new hidden field for each <input type="checkbox">

<input type="hidden" name="_type" value="on">

I am using Boostrap CSS library for the form design. How can I stop this from auto generating the hidden fields in the form.

When I submit the form with method="get" these hidden values are appearing in the browser address bar.

0

There are 0 best solutions below