Advertisement:

Author Topic: how to create a price drop-down select box on search  (Read 433 times)

Ansel

  • Newbie
  • *
  • Posts: 7
how to create a price drop-down select box on search
« on: November 27, 2017, 02:53:13 pm »
Hi guys how do i create a price drop-down select box with options on the search?

This code i have in my theme:
Code: [Select]
      <input placeholder="<?php osc_esc_html(_e('Price''ctg_housing')) ; ?> <?php osc_esc_html(_e('Min''ctg_housing')) ; ?>" type="text" id="priceMin" name="sPriceMin" value="<?php echo osc_esc_html(osc_search_price_min()); ?>" onkeypress="return isNumber(event)" />

Hope on some help

Thanks

Ansel

  • Newbie
  • *
  • Posts: 7
Re: how to create a price drop-down select box on search
« Reply #1 on: November 27, 2017, 09:02:07 pm »
Guys why this code is not working? i receive a error!

Code: [Select]
      <select  id="priceMin" name="sPriceMin">
        <option value="">Price Min</option>
        <option value="5000" <?php if(osc_search_price_min() == 5000) echo 'selected' ?>>P5,000</option>
        <option value="100001" <?php if(osc_search_price_min() == 100001) echo 'selected' ?>>P100,001</option>
        <option value="300001" <?php if(osc_search_price_min() == 300001) echo 'selected' ?>>P300,001</option>
        <option value="500001" <?php if(osc_search_price_min() == 500001) echo 'selected' ?>>P500,001</option>
        <option value="1000001" <?php if(osc_search_price_min() == 1000001) echo 'selected' ?>>P1,000,001</option>
        <option value="1300001" <?php if(osc_search_price_min() == 1300001) echo 'selected' ?>>P1,300,001</option>
        <option value="1500001" <?php if(osc_search_price_min() == 1500001) echo 'selected' ?>>P1,500,001</option>
        <option value="3000001" <?php if(osc_search_price_min() == 3000001) echo 'selected' ?>>P3,000,001</option>
        <option value="6000001" <?php if(osc_search_price_min() == 6000001) echo 'selected' ?>>P6,000,001</option>
        <option value="10000001" <?php if(osc_search_price_min() == 10000001) echo 'selected' ?>>P10,000,001</option>
        <option value="15000001" <?php if(osc_search_price_min() == 15000001) echo 'selected' ?>>P15,000,001</option>
        <option value="20000001" <?php if(osc_search_price_min() == 20000001) echo 'selected' ?>>P20,000,001</option>
        <option value="25000001" <?php if(osc_search_price_min() == 25000001) echo 'selected' ?>>P25,000,001</option>
        <option value="30000001" <?php if(osc_search_price_min() == 30000001) echo 'selected' ?>>P30,000,001</option>
        <option value="40000001" <?php if(osc_search_price_min() == 40000001) echo 'selected' ?>>P40,000,001</option>
      </select>

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: how to create a price drop-down select box on search
« Reply #2 on: November 27, 2017, 09:13:45 pm »
; after 'selected'

Ansel

  • Newbie
  • *
  • Posts: 7
Re: how to create a price drop-down select box on search
« Reply #3 on: November 27, 2017, 09:38:03 pm »
If you mean this way i still receive a error when you select the price range!

      <select  id="priceMin" name="sPriceMin">
        <option value="">Price Min</option>
        <option value="5000" <?php if(osc_search_price_min() == 5000) echo 'selected'; ?>>P5,000</option>
        <option value="100001" <?php if(osc_search_price_min() == 100001) echo 'selected'; ?>>P100,001</option>
        <option value="300001" <?php if(osc_search_price_min() == 300001) echo 'selected'; ?>>P300,001</option>
        <option value="500001" <?php if(osc_search_price_min() == 500001) echo 'selected'; ?>>P500,001</option>
        <option value="1000001" <?php if(osc_search_price_min() == 1000001) echo 'selected'; ?>>P1,000,001</option>
        <option value="1300001" <?php if(osc_search_price_min() == 1300001) echo 'selected'; ?>>P1,300,001</option>
        <option value="1500001" <?php if(osc_search_price_min() == 1500001) echo 'selected'; ?>>P1,500,001</option>
        <option value="3000001" <?php if(osc_search_price_min() == 3000001) echo 'selected'; ?>>P3,000,001</option>
        <option value="6000001" <?php if(osc_search_price_min() == 6000001) echo 'selected'; ?>>P6,000,001</option>
        <option value="10000001" <?php if(osc_search_price_min() == 10000001) echo 'selected'; ?>>P10,000,001</option>
        <option value="15000001" <?php if(osc_search_price_min() == 15000001) echo 'selected'; ?>>P15,000,001</option>
        <option value="20000001" <?php if(osc_search_price_min() == 20000001) echo 'selected'; ?>>P20,000,001</option>
        <option value="25000001" <?php if(osc_search_price_min() == 25000001) echo 'selected'; ?>>P25,000,001</option>
        <option value="30000001" <?php if(osc_search_price_min() == 30000001) echo 'selected'; ?>>P30,000,001</option>
        <option value="40000001" <?php if(osc_search_price_min() == 40000001) echo 'selected'; ?>>P40,000,001</option>
      </select>