close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Search bar on more than one page

Thread began 12/29/2009 6:34 am by muddysmurf | Last modified 12/31/2009 1:54 pm by Eric Mittman | 1899 views | 6 replies |

muddysmurf

Search bar on more than one page

I have a search bar that is going to be in my header. Let's say it's going to be on about 7 pages. I see this all the time, and I could do it manually but I don't feel like doing all of the code work. I know this has to be possible with dataassist search wizard.

Last night, I was on my index.php page (where my search form name/id is searchme). I did the dataassist search wizard, but it wouldn't let me choose that form. I then had to choose a page that I was going to use..so I chose search.php.

Finally, once finished, I ended up with another form on search.php, but a lot of code on the index.php. It apparently doesn't work lol

What is the easiest way to put this search on the different pages that I need...and use one results page.

Thanks!

Sign in to reply to this post

Eric Mittman

Having a search occur from different pages on the site is fairly straight forward. The results page is just looking for posted values. So all you need to do to get the search on multiple page is add in the currently working search form that you have to the pages where you would like the search to be performed from.

So long as the form is posting to the results page you should get the same results regardless of where you initiate the search.

Sign in to reply to this post

muddysmurf

I matched up everything to the form.. but when I search for something, it shows all of the items in the database.

Not sure why this is occurring considering I compared another site that I did a while back to this one. They are done a little differently with how the search fields are laid out, but that shouldn't matter.

I have a feeling it may be the way I coded the search bar...

I'll post my code up later tonight, since I am at work.

Sign in to reply to this post

muddysmurf

The form is:

<div id="searchwrapper"><form action="search.php" name="searchme" id="searchme">
<input type="text" class="searchbox" name="s" value="" />
<input type="image" src="images/blankSearch.png" class="searchbox_submit" name="" value="Submit" />
<table cellpadding="2" cellspacing="0" border="0">
<tr>
<td align="center"><input type="hidden" name="WADbSearch1" value="Submit" /></td>
</tr>
</table>
</form>
</div>


reason I'm thinking it might be the form is the way the last two inputs are.. I have an image for my "submit" button..and then when I added the search, it made it hidden. I could be totally wrong though.

I may have to rip every piece of code out and try again...

Sign in to reply to this post

Eric Mittman

The form here seems ok to me, but depending on how your search is setup you may not be triggering it properly. If you can please post back with your results page in a zip archive so that we can take a look at it.

I will check on some things to see if the triggers match up and try to determine why you are not getting the search to work.

Also, do you have a search form anywhere on the site that is working? If so please post back with this as well in a zip archive.

Sign in to reply to this post

muddysmurf

Here is the zip file.

Attached Files
search.zip
Sign in to reply to this post

Eric Mittman

It looks like you have the trigger for the search specified as:

php:
if ((isset($_POST["WADbSearch1"])) && ($_POST["WADbSearch1"] != "")) {



This is just looking for the posted WADBSearch1 variable. It looks like your form has this as a hidden form element in it. Looking further into the search criteria that is set on this page I can see that you are looking to do a keyword type of comparison with includes using the $_POST["advancedText"] value. I do not see this value in your search form that you posted. It looks like the only field in the form is named 's'.

I think that you could get the search page working for this form if you altered line 20 of the search page to be like this:

php:
$WADbSearch1->keywordComparison($KeyArr1,"s","AND","Includes",",%20","%20","%22","%22",0);



This could potentially break other search forms on your site though if they rely on the other value to be submitted. The best thing to do would be to look at a search form you have that is currently working and ensure that the other search forms have the same inputs in them.

Sign in to reply to this post

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...