Search not appending to URL using GET

Posted 1 month ago by ChrisF79

I have the code below (looks like a lot but it's not) and when I make choices in the form and hit submit, it appends /listings/?search%5B%5D= but it does not put any values at all in the URL. It seems so ridiculous but I have no idea why it is doing that.

How do I get my form to actually put the values in the URL?

Thanks!

<!-- Hero -->
<section id="hero">
<div class="container">
<div class="col-md-12 mx-auto">

    <form method="get" action="listings/" id="searchForm">
      <div class="form-row">
        <div class="col">
            <!-- Minimum Price -->
            <select class="form-control mb-2" id="MinPrice">
                <option value="">Minimum Price</option>
                <option value="50000">,000</option>
                <option value="75000">,000</option>
                <option value="100000">0,000</option>
                <option value="125000">5,000</option>
                <option value="150000">0,000</option>
                <option value="175000">5,000</option>
                <option value="200000">0,000</option>
                <option value="225000">5,000</option>
                <option value="250000">0,000</option>
                <option value="275000">5,000</option>
                <option value="300000">0,000</option>
                <option value="325000">5,000</option>
                <option value="350000">0,000</option>
                <option value="375000">5,000</option>
                <option value="400000">0,000</option>
                <option value="425000">5,000</option>
                <option value="450000">0,000</option>
                <option value="475000">5,000</option>
                <option value="500000">0,000</option>
                <option value="550000">0,000</option>
                <option value="600000">0,000</option>
                <option value="650000">0,000</option>
                <option value="700000">0,000</option>
                <option value="750000">0,000</option>
                <option value="800000">0,000</option>
                <option value="850000">0,000</option>
                <option value="900000">0,000</option>
                <option value="950000">0,000</option>
                <option value="1000000">,000,000</option>
                <option value="1100000">,100,000</option>
                <option value="1200000">,200,000</option>
                <option value="1300000">,300,000</option>
                <option value="1400000">,400,000</option>
                <option value="1500000">,500,000</option>
                <option value="1600000">,600,000</option>
                <option value="1700000">,700,000</option>
                <option value="1800000">,800,000</option>
                <option value="1900000">,900,000</option>
                <option value="2000000">,000,000</option>
                <option value="2100000">,100,000</option>
                <option value="2200000">,200,000</option>
                <option value="2300000">,300,000</option>
                <option value="2400000">,400,000</option>
                <option value="2500000">,500,000</option>
                <option value="2750000">,750,000</option>
                <option value="3000000">,000,000</option>
                <option value="3250000">,250,000</option>
                <option value="3500000">,500,000</option>
                <option value="3750000">,750,000</option>
                <option value="4000000">,000,000</option>
                <option value="4250000">,250,000</option>
                <option value="4500000">,500,000</option>
                <option value="4750000">,750,000</option>
                <option value="5000000">,000,000</option>
                <option value="5250000">,250,000</option>
                <option value="5500000">,500,000</option>
                <option value="5750000">,750,000</option>
                <option value="6000000">,000,000</option>
                <option value="6250000">,250,000</option>
                <option value="6500000">,500,000</option>
                <option value="6750000">,750,000</option>
                <option value="7000000">,000,000</option>
                <option value="7250000">,250,000</option>
                <option value="7500000">,500,000</option>
                <option value="7750000">,750,000</option>
                <option value="8000000">,000,000</option>
                <option value="8250000">,250,000</option>
                <option value="8500000">,500,000</option>
                <option value="8750000">,750,000</option>
                <option value="9000000">,000,000</option>
                <option value="9250000">,250,000</option>
                <option value="9500000">,500,000</option>
                <option value="9750000">,750,000</option>
                <option value="10000000">,000,000</option>
            </select>
        </div>



        <div class="col">
            <select class="form-control mb-2" id="MinPrice">
                <option value="">Maximum Price</option>
                <option value="50000">,000</option>
                <option value="75000">,000</option>
                <option value="100000">0,000</option>
                <option value="125000">5,000</option>
                <option value="150000">0,000</option>
                <option value="175000">5,000</option>
                <option value="200000">0,000</option>
                <option value="225000">5,000</option>
                <option value="250000">0,000</option>
                <option value="275000">5,000</option>
                <option value="300000">0,000</option>
                <option value="325000">5,000</option>
                <option value="350000">0,000</option>
                <option value="375000">5,000</option>
                <option value="400000">0,000</option>
                <option value="425000">5,000</option>
                <option value="450000">0,000</option>
                <option value="475000">5,000</option>
                <option value="500000">0,000</option>
                <option value="550000">0,000</option>
                <option value="600000">0,000</option>
                <option value="650000">0,000</option>
                <option value="700000">0,000</option>
                <option value="750000">0,000</option>
                <option value="800000">0,000</option>
                <option value="850000">0,000</option>
                <option value="900000">0,000</option>
                <option value="950000">0,000</option>
                <option value="1000000">,000,000</option>
                <option value="1100000">,100,000</option>
                <option value="1200000">,200,000</option>
                <option value="1300000">,300,000</option>
                <option value="1400000">,400,000</option>
                <option value="1500000">,500,000</option>
                <option value="1600000">,600,000</option>
                <option value="1700000">,700,000</option>
                <option value="1800000">,800,000</option>
                <option value="1900000">,900,000</option>
                <option value="2000000">,000,000</option>
                <option value="2100000">,100,000</option>
                <option value="2200000">,200,000</option>
                <option value="2300000">,300,000</option>
                <option value="2400000">,400,000</option>
                <option value="2500000">,500,000</option>
                <option value="2750000">,750,000</option>
                <option value="3000000">,000,000</option>
                <option value="3250000">,250,000</option>
                <option value="3500000">,500,000</option>
                <option value="3750000">,750,000</option>
                <option value="4000000">,000,000</option>
                <option value="4250000">,250,000</option>
                <option value="4500000">,500,000</option>
                <option value="4750000">,750,000</option>
                <option value="5000000">,000,000</option>
                <option value="5250000">,250,000</option>
                <option value="5500000">,500,000</option>
                <option value="5750000">,750,000</option>
                <option value="6000000">,000,000</option>
                <option value="6250000">,250,000</option>
                <option value="6500000">,500,000</option>
                <option value="6750000">,750,000</option>
                <option value="7000000">,000,000</option>
                <option value="7250000">,250,000</option>
                <option value="7500000">,500,000</option>
                <option value="7750000">,750,000</option>
                <option value="8000000">,000,000</option>
                <option value="8250000">,250,000</option>
                <option value="8500000">,500,000</option>
                <option value="8750000">,750,000</option>
                <option value="9000000">,000,000</option>
                <option value="9250000">,250,000</option>
                <option value="9500000">,500,000</option>
                <option value="9750000">,750,000</option>
                <option value="10000000">,000,000</option>
            </select>
          </div> <!-- end col -->
    </div><!-- End Row -->

    <div class="form-row">
          <div class="col">
            <select class="form-control mb-2" id="bedrooms">
                <option value="">Minimum Bedrooms</option>
                <option value="0">Studio</option>
                <option value="1">1 Bedroom</option>
                <option value="2">2 Bedrooms</option>
                <option value="3">3 Bedrooms</option>
                <option value="4">4 Bedrooms</option>
                <option value="5">5 Bedrooms</option>
                <option value="6">6 or More Bedrooms</option>
            </select>
          </div>

      <div class="col">
            <select class="form-control mb-2" id="bathrooms">
                <option value="">Minimum Bathrooms</option>
                <option value="1">1 Bathrooms</option>
                <option value="2">2 Bathrooms</option>
                <option value="3">3 Bathrooms</option>
                <option value="4">4 Bathrooms</option>
                <option value="5">5 Bathrooms</option>
                <option value="6">6 or More Bathrooms</option>
            </select>
          </div>

    </div> <!-- End row 2 -->


    <div class="form-row">
          <div class="col">
            <select class="form-control mb-2" id="bedrooms">
                <option value="">Minimum Square Feet</option>
                <option value="1000">1,000+</option>
                <option value="1250">1,250+</option>
                <option value="1500">1,500+</option>
                <option value="1750">1,750+</option>
                <option value="2000">2,000+</option>
                <option value="2500">2,500+</option>
                <option value="3000">3,000+</option>
                <option value="4000">4,000+</option>
                <option value="5000">5,000+</option>
                <option value="6000">6,000+</option>
            </select>
          </div>

      <div class="col">
        <button type="submit" id="search" name="search[]" class="listingbutton btn w-100"><i class="fas fa-home mr-2"></i>Find My Home</a></button>
      </div>

    </div> <!-- End row 3 -->

</form>
</section>

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.