close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Can the Search function do this?

Thread began 4/10/2012 1:06 am by eric284736 | Last modified 4/27/2012 10:00 pm by eric284736 | 1717 views | 14 replies |

eric284736

Can the Search function do this?

Hi Jason,

By the time all of this is said and done I should have a pretty good handle on the DataAssist Search.

If you take a look at this site:
s_10153_12605_Appliances_Refrigerators_French+Door+Refrigerators?filter=Appliance+Brand%7cKenmore&storeId=10153&sName=French+Door+Refrigerators&vName=Appliances&cName=Refrigerators&viewItems=25&catalogId=12605&keywordSearch=false&i_cntr=1334033858679

I would like to setup something similar and even have the ability to remove filters that have been applied to the search so the user can narrow down or increase the search range.

Can DataAssist do something like this?

thx
Eric

Sign in to reply to this post

Jason ByrnesWebAssist

yes, you can do something similar in data assist search, but it will require hand coding, a good knowledge of querystring variables and how to manipulate links.

the key is to make sure that the search is configured to use the GET method instead of the POST method.


using the GET Method, the search parameters are passed using querystring variables


you can create links that clear a querysting variable, but retain the rest. the exact code to do this will depend on how your search is configured, and the querystring variables that it produces

Sign in to reply to this post

eric284736

Thanks Jason!

I am going to start with a test setup. I should setup the initial search links in a form, but I can set the submit function to be the text. So I will have mutiple forms on the main search page. Or does every link need to be a form including the links that will appear on the results page?

This is NOT my test page, but it is what I currently have and I want to make this more robust.
0linksearch.php

So after clicking on the search page links, you are taken to the results page. From those results let's say I just want to see Aparments available in France, so I click Apartments and now the results show just apartments in France. Now I want to narrow that down to just aparments in Paris. Does that make sense?

thx
Eric

Sign in to reply to this post

Jason ByrnesWebAssist

yes, you will need to set the initial search up to have filter those criteria, then set the links to pass the necessary query string variables to trigger the filtering.

Sign in to reply to this post

eric284736

thanks!

I have setup a test now. I made the first form and ran the search wizard, but it added a form button to the search form:

<form id="form1" name="form1" method="get" action="00-results.php">
<input name="Country" type="hidden" id="Country" value="France" />
<input name="SearchType" type="hidden" id="SearchType" value="Sale" />
<a href="javascript:document.form1.submit();">Sale Properties in France</a>
<table cellpadding="2" cellspacing="0" border="0">
<tr>
<td align="center"><input type="submit" name="WADbSearch1" value="Submit" /></td>
</tr>
</table>
</form>

I need to keep the WADbSearch1 name to trigger the search function, correct? So how to I keep that without having the submit button?

thx
Eric

Sign in to reply to this post

Jason ByrnesWebAssist

by adding it as a querystring variable:

00-results.php?Country=France&WADbSearch1=Submit


this is why you use the GET method for the search form

the GET method passes the form elements as querystring variables.

Sign in to reply to this post

eric284736

thanks Jason!

I am going to post issues as I run into them, if that is okay.

On my results page I have my recordset defined and I have 1 WHERE clause set (DisplayOnSite = '1').

Can I add another WHERE clause directly in the recordset and not affect the search behavior? I ask because I have a field named Country in the Properties table and in the Area table there is also a Country field which is giving me the response:

Column 'Country' in where clause is ambiguous

How should I define which table column, in the Search Behavior Where clause or in the recordset?

thx
Eric

Sign in to reply to this post

Jason ByrnesWebAssist

this happens when your recordset is using a join query and you have the same column name in both tables, to fix this error, you will need to edit the DataAssist Search code to add the table name, send a copy of the page an I can tell you what will need changing.

Sign in to reply to this post

eric284736

Here you go Jason.

Thx
Eric

Attached Files
00-results.zip
Sign in to reply to this post

Jason ByrnesWebAssist

change this line:

php:
$WADbSearch1->addComparison("Country","".((isset($_GET["Country"]))?$_GET["Country"]:"")  ."","AND","=",0);




to include the table name:

php:
$WADbSearch1->addComparison("tblName.Country","".((isset($_GET["Country"]))?$_GET["Country"]:"")  ."","AND","=",0);
Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...