Skip to content

Instantly share code, notes, and snippets.

Last active January 4, 2016 07:49
Show Gist options
  • Save technovangelist/8591395 to your computer and use it in GitHub Desktop.
Save technovangelist/8591395 to your computer and use it in GitHub Desktop.
Shortcode Template for Area and Sub Area in Single Dropdown
<div class="search-item">
<select id=hoodselect name='hood-select'>
<option value="">Any</option>
<div class="search-item">
<label>Min Beds:</label>[min_beds]
<div class="search-item">
<label>Min Baths:</label>[min_baths]
<div class="search-item">
<label>Min Price:</label>[min_price]
<div class="search-item">
<label>Max Price:</label>[max_price]
<div class="search-item">
<div class="search-item ">
<input type="submit" name="submit" value="Search Now!">
<input type='hidden' id='location-neighborhood' name='location&#91;neighborhood]' ></input>
<input type='hidden' id='metadata-subdivision' name='metadata[sub_area]' ></input>
form.pls_search_form_listings .search-item { float: left; margin-bottom: 20px; width: 30%; display: inline-block; margin-left: 2.9%; }
@media (max-width: 979px) { form.pls_search_form_listings .search-item { margin-bottom: 5px; } }
form.pls_search_form_listings .search-item label { float: left; width: 100%; }
@media (min-width: 768px) and (max-width: 979px) { form.pls_search_form_listings .search-item { margin-left: 2%; } }
@media (max-width: 767px) { form.pls_search_form_listings .search-item { margin-left: 2%; width: 47%; } }
@media (max-width: 420px) { form.pls_search_form_listings .search-item { margin-left: 2%; width: 97%; } }
form.pls_search_form_listings .search-item select, form.pls_search_form_listings .search-item .chzn-container { width: 80% !important; }
<div style="clear:both"></div></div>
var neighborhoods = {
"Sea Pines": [
"Club Course",
"Harbour Town",
"Ocean Course",
"Ocean Side",
"Heron Pointe/Sea Marsh Course",
"South Beach",
"Forest Beach": [
"North Forest Beach",
"South Forest Beach"
"Long Cove":[],
"Palmetto Dunes/Shelter Cove":[
"Inverness Side",
"Mariners Side",
"Shelter Cove"
"Folly Field":[],
"Port Royal":[
"Barony Course",
"Ocean Side Port Royal Drive",
"Robbers Row Course",
"Sound Side Port Royal Drive"
"Hilton Head Plantation":[
"Bear Creek Course",
"Country Club of Hilton Head",
"Dolphin Head Course",
"Oyster Reef Course",
"Shell Streets",
"w/in 1/2 mile of Country Club"
"Palmetto Hall":[],
"Indigo Run":[
"Broad Point",
"Golden Bear",
"Golf Club",
"River Club"
"Spanish Wells":[],
"Windmill Harbour":[],
"HH/Off Plantation":[
"Broad Creek Area",
"Fish Haul",
"Marshland Road",
"Palmetto Bay",
"Palmetto Headlands",
"Point Comfort",
"Spanish Wells Road",
"Wild Horse/Squire Pope",
"Beach City Road",
"Singleton by the Beach"
"Daufuskie Island":[
"Bloody Point",
"Haig Point",
"Oak Ridge",
"Cedar Cove"
"Bluffton/Off Plantation":[
"170 North to Oldfield",
"170 South to 46",
"Alljoy Rd Area",
"Burnt Church Rd to Simmonsville" ,
"Downtown Bluffton",
"Gibbet Rd to Jasper County",
"Graves Bridge to Burnt Church Rd",
"Pinckney Colony",
"Simmonsville Rd to 170",
"Simmonsville Rd to Gibbet Rd",
"Bluffton: Buckwalter Parkway",
"Old Carolina/The Traditions"
"Moss Creek":[],
"Colleton River":[],
"Rose Hill":[
"Estate Side",
"Golf Course Side"
"Berkeley Hall":[],
"Palmetto Bluff":[],
"Sun City/Riverbend":[
"Sun City",
"Callawassie Island":[],
"Spring Island":[],
"Beauf.Co - N. of Broad River":[],
"Beauf.Co - S. of Broad River":[
"Beaufort-South of Broad River",
"Oldfield to Beaufort",
"Heywart Point",
"Chechessee Creek Club"
"Dataw Island":[],
"Hampton Hall":[],
"Hampton Pointe" :[],
"Hilton Head Lakes" :[],
"Hampton Lake":[],
"Jasper County":[
"170 to 195",
"Bees Creek",
"The Settings at Mackays Point"
"Barnwell County":[],
"Colleton County":[],
"Hamption County":[],
"Orangeburg County":[],
"Bamberg County":[],
"Hilton Head South":[],
"Hilton Head South":[],
"Hilton Head Northwest":[],
"Off Island":[]
function createOption(key,value){
return '<option value="' + value +'">' + key + '</option>';
function buildOptions(parent, childArray){
output= createOption(parent,parent);
output+=createOption('-- '+ child, child);
return output;
for (hood in neighborhoods) {
jQuery("#hoodselect").change(function () {
str = jQuery("#hoodselect").val();
} else {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment