Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:36

Search help


Poster: guitar187
Dated: Tuesday March 23 2004 - 23:37:06 GMT

I recently setup a search form in the menu. Everything seems to work fine, except for the results that I'm getting.

For instance, I have a search form setup in the middle of my index page. If I run a search from there everything seems to work fine. However, if I run the search from the Milonic menu, I don't get any results. Any ideas would be appreciated.

Below is my code for both the menu and the index page. Also my URL is http://www.alliemae.org


My menu code looks like this:
with(milonic=new menuname("Search")){
style=XPMenuStyle;
overflow="scroll";
margin=4;
aI("text=<form action=http://alliemae.org//SearchEngine/search.pl method=get><div align=center><font size=-1><input type=hidden name=p value=1 /><input type=hidden name=lang value=en /><input type=hidden name=include value= /><input type=hidden name=exclude value= /><input type=hidden name=penalty value=0 /></font> <font size=-1><input type=text name=q maxlength=15 size=15 /></font><br><font size=-1><input type=submit value=Search name=submit /></font> </div></form>;type=form;align=center;");
}


My index page code looks like this:
<form action="http://alliemae.org//SearchEngine/search.pl" method="get">
<h6 align="center">
<input type="hidden" name="p" value="1" />
<input type="hidden" name="lang" value="en" />
<input type="hidden" name="include" value="" />
<input type="hidden" name="exclude" value="" />
<input type="hidden" name="penalty" value="0" />
<font color="#FFFFFF"> Search for:</font>
<input type="text" name="q" />
<input type="submit" value="Search" name="submit" />
</h6>
</form>


Poster: kevin3442
Dated: Wednesday March 24 2004 - 3:53:59 GMT

Hello,

Haven't tried putting a form inside of a menu item myself, but offhand I have a couple of suggestions:

The form in the body and the form in the menu item generate two different queries (I searched for mortgage as a test):

Form in the body (works):
Code:
http://alliemae.org//SearchEngine/search.pl?p=1&lang=en&include=&exclude=&penalty=0&q=mortgage&submit=Search

Form in the menu item:
Code:
http://alliemae.org//SearchEngine/search.pl?p=1&lang=en&include=%2F&exclude=%2F&penalty=0&q=mortgage&submit=Search

Note that the differences are in two of the parameters passed in the url: include and exclude. From the menu item search, they are passed as %2F. Why? Because %2F is the url code for a forward slash (/)... the hex equivalent of decimal 47 in the ISO 8859-1 character set. How'd it get there? Two reasons: (1) you didn't specify a value for those two hidden fields in the form (you have value= but no value), so... (2) it took the next character, /, as the value, because you close some of your tags with /> instead of > (I'd avoid doing that unless you have a specific reason for it).

What to do? In the menu item search, use two consecutive single-quotes to assign a null value to the exclude and include hidden fields... don't put a space between them. Like so:
Code:
...<input type=hidden name=include value=''>...

That's my guess as to the main culprit.

Let us know if that helps.

Kevin


Poster: guitar187
Dated: Wednesday March 24 2004 - 7:11:26 GMT

Works great! I definitly feel a bit dumb, but I sincerely appreciate your help. Let me know if you ever need a favor.

Thanks,

Jon


Poster: kevin3442
Dated: Wednesday March 24 2004 - 16:52:30 GMT

Hi Jon,
guitar187 wrote:
...I definitly feel a bit dumb...

I hope that's not from anything I said. Believe me, I've been there several times myself... I have the palm marks on my forehead to prove it. ;)

Glad it worked. I like your site layout by the way, and the menu looks good.

Kevin