Custom search (and keeping dropdown inputs)
-
Hi guys,
I’m trying to put together a custom search form based on your search widget, it’ll be just below the header and I intend for it to be all dropdowns.
The only problem I’m having is that when I run the search, the dropdowns return to their default position.
I’ve been fiddling with this all day, so any advice would be greatly appreciated.
Here’s my code, please forgive any sloppiness, I’ve been at it so long, I’m zombified tired!
<div id="propertysearch"> <section id="searchpropertieswidget-4" class="widget wpp_property_attributes"><div class="wpp_search_properties_widget"><span class="wpp_widget_no_title"></span> <?php if($_POST["submit"]) { $name_title = $_POST["wpp_search[property_type]"]; } ?> <form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" method="post" class="wpp_shortcode_search_form"> <input type="hidden" name="wpp_search[pagination]" value="off"> <input type="hidden" name="wpp_search[strict_search]" value="false"> <ul class="wpp_search_elements"> <li class="wpp_search_group wpp_group_not_a_group"> <ul class="wpp_search_group wpp_group_not_a_group"> <li for="wpp_search_element_4963" class="typemargin wpp_search_label wpp_search_label_property_type">Type<span class="wpp_search_post_label_colon">:</span> <li class="wpp_search_form_element seach_attribute_property_type wpp_search_attribute_type_property_type "> <div class="wpp_search_attribute_wrap"> <select id="wpp_search_element_6302" class="wpp_search_select_field wpp_search_select_field_property_type property_type" name="wpp_search[property_type]"> <?php $names = array( '' => 'Any', 'house_rental' => 'House (rental)', 'apartment_rental' => 'Apartment (rental)', ); foreach ($names as $key => $name) { $selection = ($key === $name_title) ? 'selected="selected"' : ''; echo '\t<option value="' . $key . '" ' . $selection. '> ' . $name . '</option>'; } ?> ?> </select> </div>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Custom search (and keeping dropdown inputs)’ is closed to new replies.