Main
Index
Search
Posts
Who's
Online
Log
In

Home: Discontinued/Classic Products: Instant Website: Realty/Listings/Auto:
Search Help

 

 


texascoffee
User

Jul 15, 2009, 5:54 PM

Post #1 of 12 (2654 views)
Shortcut
Search Help Can't Post

Hello,

I have found many posts referencing searching. However, none of the information gives me a complete picutre.

The primary function of the website is to provide a client interface with the 600+ properties that we have for sale. Everything else is just window dressing - about us, news, calculators, etc. There is a search box on every page of the website to allow users to search listings whenever they have the need. Here is the basic code:

<form id="SearchForm" enctype="multipart/form-data" method="post" action="/cmsAdmin/listings.php">
<div class="indent">
<div class="container">
<div class="col-1">
<div class="rowi">
City or Zip Code<br />
<input type="text" class="input" name="city"/>
</div>
<div class="rowi container">
<div class="col-4">
Price Range<br />
</div>
<div class="select">
min<br />
<select name="price_max">
<option value="0">any</option>
<option value="0">$0</option>
<option value="50000">$50,000</option>
<option value="75000">$75,000</option>
<option value="100000">$100,000</option>
<option value="150000">$150,000</option>
<option value="250000">$250,000</option>
<option value="500000">$500,000</option>
<option value="1000000">$1,000,000</option>
</select>
</div>
<div class="select">
max<br />
<select name="price_min">
<option value="0">any</option>
<option value="0">$0</option>
<option value="50000">$50,000</option>
<option value="75000">$75,000</option>
<option value="100000">$100,000</option>
<option value="150000">$150,000</option>
<option value="250000">$250,000</option>
<option value="500000">$500,000</option>
<option value="1000000">$1,000,000</option>
</select>
</div>
</div>
<div class="rowi container"><div class="col-4">
Square Feet<br />
</div>
<div class="select">
min<br />
<select name="sqft_min">
<option selected="selected" value="0">any</option>
<option value="250">250 sqft</option>
<option value="500">500 sqft</option>
<option value="1000">1,000 sqft</option>
<option value="1250">1,250 sqft</option><option value="1500">1,500 sqft</option>
<option value="1750">1,750 sqft</option>
<option value="2000">2,000 sqft</option>
<option value="2250">2,250 sqft</option>
<option value="2750">2,750 sqft</option>

<option value="3000">3,000 sqft</option>
<option value="3250">3,250 sqft</option>
<option value="3500">3,500 sqft</option>
<option value="3750">3,750 sqft</option>
<option value="4000">4,000 sqft</option>
<option value="5000">5,000 sqft</option>

<option value="10000">10,000 sqft</option>
</select>
</div>
<div class="select">
max<br />
<select name="sqft_max">
<option selected="selected" value="0">any</option>
<option value="250">250 sqft</option>
<option value="500">500 sqft</option>
<option value="1000">1,000 sqft</option>
<option value="1250">1,250 sqft</option>

<option value="1500">1,500 sqft</option>
<option value="1750">1,750 sqft</option>
<option value="2000">2,000 sqft</option>
<option value="2250">2,250 sqft</option>
<option value="2500">2,500 sqft</option>
<option value="2750">2,750 sqft</option>

<option value="3000">3,000 sqft</option>
<option value="3250">3,250 sqft</option>
<option value="3500">3,500 sqft</option>
<option value="3750">3,750 sqft</option>
<option value="4000">4,000 sqft</option>
<option value="5000">5,000 sqft</option>

<option value="10000">10,000 sqft</option>
</select>
</div>
</div>
</div>
<div class="col-2">
<div class="rowi container">
<div class="select">
beds<br />
<select name="bedrooms_min">
<option value="">any</option>
<option value="1">1+</option>
<option value="2">2+</option>
<option value="3">3+</option>
<option value="4">4+</option>
<option value="5">5+</option>
<option value="6">6+</option>
</select>
</div>
<div class="select">
baths<br />
<select name="bathrooms_min">
<option value="">any</option>
<option value="1">1+</option>
<option value="2">2+</option>
<option value="3">3+</option>
<option value="4">4+</option>
<option value="5">5+</option>
<option value="6">6+</option>
</select>
</div>
</div>
<a class="link2" onclick="document.getElementById('SearchForm').submit()">Search</a> </div>
</div>
</div>
</form>

Is it possible to tie the elements above into a results page of listings for the user? I have plenty of html experience, but practically no php knowledge. I have used the online documentation to get just about everything set up excluding a couple of plugins and this search box issue.

Thanks in advance for your help!

Mike


ross
Staff / Moderator


Jul 16, 2009, 10:36 AM

Post #2 of 12 (2651 views)
Shortcut
Re: [texascoffee] Search Help [In reply to] Can't Post

Hi Mike

Thanks for posting!

The search results page can actually be the exact same page as your main listings page. So if you had already setup something like listings.php that shows each of your listings, just point all your forms at that same page.

Then, you need to make sure each element in your form is named the same as the fields in your database. I see you are also using the modifies for min/max so it looks like you know how that works already. Just make sure if you are using price_min and price_max that you actually have a field called price. Same thing for sqft_min and sqft_max, you'll need a field called sqft.

Does that make sense? Let me know what you think :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Product Specialist
support@interactivetools.com

Hire me!  Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/



texascoffee
User

Jul 17, 2009, 10:36 AM

Post #3 of 12 (2640 views)
Shortcut
Re: [ross] Search Help [In reply to] Can't Post

Ok, everything is working fine except the "city or zip" field. What do I need to replace this <input type="text" class="input" name="city"/> with to achieve the "or" function that we discussed on the phone. Ie, <input type="text" class="input" name="city,zip"/> or <input type="text" class="input" name="city" or "zip"/>, I have tried these and several others with no luck.


ross
Staff / Moderator


Jul 17, 2009, 2:35 PM

Post #4 of 12 (2634 views)
Shortcut
Re: [texascoffee] Search Help [In reply to] Can't Post

Hi there.

Thanks for the update!

The thing here is that Instant Realty Website is actually "AND" searching. I actually though that's what you wanted anyway. "AND" searching really narrows down the results so you don't end up with 600 listings and then have to still refine the list.

What I think you'll want to do instead is have one field for each of those so:

<input name="city">
<input name="zip">

Keep in mind the names in these fields must be the same name as the fields in your database.

Give it a shot and let me know how you make out :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Product Specialist
support@interactivetools.com

Hire me!  Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/



texascoffee
User

Jul 17, 2009, 5:42 PM

Post #5 of 12 (2629 views)
Shortcut
Re: [ross] Search Help [In reply to] Can't Post

You are right. I got it backwards. Thanks for your help!


texascoffee
User

Jul 17, 2009, 8:51 PM

Post #6 of 12 (2623 views)
Shortcut
Re: [texascoffee] Search Help [In reply to] Can't Post

I am still missing the one field with several variables. For example, lets say a client wants to narrow the search down to Dallas, zip code, street, school district. Rather than have 4 text input fields, I would like one text field (to save space). Is this possible?


ross
Staff / Moderator


Jul 21, 2009, 9:52 AM

Post #7 of 12 (2560 views)
Shortcut
Re: [texascoffee] Search Help [In reply to] Can't Post

Hi there

There are probably some options for having one field search a bunch of different fields but that's only because anything is possible if you use enough code. The problem is that something like that will end up being really complicated so separate fields is definitely going to be the way to go.

Keep me up to date with how you are making out :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Product Specialist
support@interactivetools.com

Hire me!  Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/



texascoffee
User

Jul 21, 2009, 10:06 AM

Post #8 of 12 (2558 views)
Shortcut
Re: [ross] Search Help [In reply to] Can't Post

Thanks for your response Ross!

Most of my competition use this combined search function (usually city + zip + county). It would save me a ton of space and "declutter" the search box. Again, I only want to use one field to search a few variables - this can't be that complicated compared to what is included with CMSBuilder already.


ross
Staff / Moderator


Jul 22, 2009, 8:20 AM

Post #9 of 12 (2539 views)
Shortcut
Re: [texascoffee] Search Help [In reply to] Can't Post

Hi there.

It does actually end up being a little tricky as we would have to figure out how to split what you have in that box into separate data so you can search the different database fields. Also, there would be situations where someone enters two of the three things or even just one. There would need to be away to figure out what they actually entered so it searches the right fields in your system.

If it was possible to say on the forum what you need to enter in that field, there would be some options. Does your forum have room for some instructions?

Let me know :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Product Specialist
support@interactivetools.com

Hire me!  Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/



Dave
Staff / Moderator


Jul 27, 2009, 12:39 PM

Post #10 of 12 (2476 views)
Shortcut
Re: [texascoffee] Search Help [In reply to] Can't Post

You can have a field that searches for a single field across multiple database fields. Would that work?

The code for that might look like this:
<input type="text" name="city,zip,country_query" value="" />

For more details on all the search features see this page:
http://www.interactivetools.com/docs/cmsbuilder/viewer_search.html

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com
 


texascoffee
User

Jul 27, 2009, 1:36 PM

Post #11 of 12 (2475 views)
Shortcut
Re: [Dave] Search Help [In reply to] Can't Post

That works great!

I just created a drop down menu that includes all of the cities and the counties where we have homes for sale. The user can now search city-by-city, or search by county (all with one box!).

Thanks for your help!


Dave
Staff / Moderator


Jul 28, 2009, 10:17 AM

Post #12 of 12 (2456 views)
Shortcut
Re: [texascoffee] Search Help [In reply to] Can't Post

Great to hear, thanks for posting back to let us know it worked! :)

Dave Edis - Senior Developer
interactivetools.com