Including search boxes

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
wuscheck
Advanced
Advanced
Posts: 16
Joined: Tue Aug 26, 2003 8:07 am

Including search boxes

Post by wuscheck »

I found several postings for this topic but I've got two additional questions concerning search boxes.

I place a search box into the main menu:

Code: Select all

$mmMenu->addItemFromText("text=`<form method=get action=http://search.atomz.com/search/>....<input size='25' name='sp_q' value='Suche' onblur='if(!this.value) this.value = this.defaultValue;' onKeyPress='return submitenter(this,event)'>...</form>`;
So far so good, but I found no way to include the following code because of the " and '. The code normally follows after the value='Suche'.

Code: Select all

onClick="if(this.value == this.defaultValue) this.value = ' ';"
And the next question:
How can I put a background image behind the form? Normally I would do it like this, but it won't work:

Code: Select all

style="background-image:url(http://www.hsghanau-handball.de/menu/images/leer.png); background-repeat:repeat-x; background-position:top"
I think it is a problem with the place because I put the style-thing into the <form>... where is the right place for it?

Thanks in advance...

wuscheck
wuscheck
Advanced
Advanced
Posts: 16
Joined: Tue Aug 26, 2003 8:07 am

Re: Including search boxes

Post by wuscheck »

I solved the style-problem by myself. The only problem left is the first one with the onclick...
wuscheck
Advanced
Advanced
Posts: 16
Joined: Tue Aug 26, 2003 8:07 am

Re: Including search boxes

Post by wuscheck »

After some code work I found out that the IE and Firefox browser display a form in the main menu in a different way.

This is the correct way but without a form tested with IE6, IE7 or FF3.5
Image

Now the menu with the form tested with IE6 and IE7. The distance between the whole menu and the blue stripe at the top of the pic is smaller, the form is on the upper margin and the date at the bottom of the menu.
Image

Now the menu with the form tested with FF 3.5.2. The distance between the whole menu and the blue stripe at the top of the pic is the same as the example before, the form and the date is now on the bottom of the menu.
Image

The right one: The distance between menu and the blue stripe from example 1 and form/date in the middle of the menu.

Do you have an idea to fix the problem(s)?

wuscheck
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: Including search boxes

Post by Ruth »

Hi,

I am working on this. It is something with how IE treats forms. I'll post back later today with anything I find. But, if you want to see what's up, take that page and remove the form then take a look at how that area looks. It's as if IE adds some kind of line below where the form is. :lol: However, I've done so much as I tested [though I tried to undo each thing], I've got to start at the beginning and make sure I haven't done something weird or left something I tried in it.

Ruth
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: Including search boxes

Post by Ruth »

Hi,

I found the problem. It seems that IE adds extra whitespace or line breaks with regard to forms. So, changing your form css solves all the problems, including the time code placement.

Code: Select all

FORM {
	
margin:0;
padding:0;
}
Ruth
wuscheck
Advanced
Advanced
Posts: 16
Joined: Tue Aug 26, 2003 8:07 am

Re: Including search boxes

Post by wuscheck »

Hi Ruth,

thank you for your support...

Now I've got the same difference in every browser... it looks now like example # 3...
Image

The distance between the whole menu and the blue stripe at the top of the pic is to small as in example #1 (double arrow). The form and the date is now on the bottom of the menu in every browser.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: Including search boxes

Post by Ruth »

Hi,

I just went to the site and your menu.css file still has

Code: Select all

form {
padding-left: 5px;
padding-right: 5px;
}
Do you have a test page where you are seeing what you showed me, so I can look at that page and find out what is going on?

Ruth
wuscheck
Advanced
Advanced
Posts: 16
Joined: Tue Aug 26, 2003 8:07 am

Re: Including search boxes

Post by wuscheck »

User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: Including search boxes

Post by Ruth »

Hi,

Well, that page is different from the main page which had the form stuff in the page. So, I have fixed it, but I will have to explain some things.

I saw that you had the itemheight in the main menu set to 40px when the actual item images are only 30. When you put that 40 px in there that is going to change how all the things work, with regard to the form and the date as to placement as the form and the date are not images. It also means that the submenus are opening what looks like 10px down from the main menu. If you had the 40px because of where you wanted the menu to be placed [that is what I assumed, but assuming isn't the best thing, anyway...] using that assumption, I made some changes, got the menu to be in the same place and got it to look the same in FF and IE7. So, try pasting this as your menu table and see if this works.

Code: Select all


            <table border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td align="right" valign="top"><img src="http://www.hsghanau-handball.de/menu/images/navi_links.png" border="0"></td>
<td align="center" valign="top">
                  <SCRIPT>
with(milonic=new menuname("Main Menu")){
style=menuStyle;
alwaysvisible="true";
orientation="horizontal";
position="relative";
itemwidth="120";
itemheight="34";
align="center";
rawcss="background-image:url(http://www.hsghanau-handball.de/menu/images/leer.png);background-repeat:repeat-x;";
zindex="9";
aI("showmenu=Aktive;image=http://www.hsghanau-handball.de/menu/images/aktive.png;overimage=http://www.hsghanau-handball.de/menu/images/aktive_hover.png;imagealign=center;imageposition=top;");
aI("showmenu=Jugend;image=http://www.hsghanau-handball.de/menu/images/jugend.png;overimage=http://www.hsghanau-handball.de/menu/images/jugend_hover.png;imagealign=center;imageposition=top;");
aI("showmenu=Infos;image=http://www.hsghanau-handball.de/menu/images/infos.png;overimage=http://www.hsghanau-handball.de/menu/images/infos_hover.png;imagealign=center;imageposition=top;");
aI("showmenu=Links;image=http://www.hsghanau-handball.de/menu/images/links.png;overimage=http://www.hsghanau-handball.de/menu/images/links_hover.png;imagealign=center;imageposition=top;");
aI("showmenu=Interaktiv;image=http://www.hsghanau-handball.de/menu/images/interaktiv.png;overimage=http://www.hsghanau-handball.de/menu/images/interaktiv_hover.png;imagealign=center;imageposition=top;");
aI("valign=top;text=`<form style='margin:0px;padding-top:5px;padding-right:5px;padding-bottom:7px;padding-left:5px' method='get' action='http://search.atomz.com/search/'><input size='25' name='sp_q' value='Suche' onblur='if(!this.value) this.value = this.defaultValue;' onKeyPress='return submitenter(this,event)'><input type='hidden' name='sp_a' value='sp10046190'><input type='hidden' name='sp_p' value='all'><input type='hidden' name='sp_f' value='ISO-8859-1'></form>`;type=form;");
aI("valign=middle;padding='1px 7px 5px 5px';text='+getMilonicDate()+';align=center;type=clock;itemwidth=68;");

}drawMenus();
</SCRIPT>
                </TD>
                <TD vAlign=top><IMG 
                  src="navi_rechts.png" 
            border=0></TD></TR> <TR>
                <TD vAlign=top align=right colspan=3><IMG 
                  src="transparent.gif" border=0 height=8 width=1></TD>
                </TR></TABLE>
Note that what I did was to add a table row below the one with the menu and inserted a transparent gif set to height=8. This along with the itemwidth=34 seems to place the menu correctly in IE6, 7, FF1.5, 2.0.0.18, 3.0.8, NN7.2, 9, Opera 9.5, 10, GoogleChrome 1+ the only one that has a problem is Safari for pc 4.0.4. I don't have the newest FF yet, am trying to figure how to get it without losing what I have. Anyway, try that and let me know if it is OK. If it isn't, I'll need to see the page on the web again, that's one problem with working on the desktop, sometimes it looks OK until it's on the web.

Ruth
wuscheck
Advanced
Advanced
Posts: 16
Joined: Tue Aug 26, 2003 8:07 am

Re: Including search boxes

Post by wuscheck »

I'm so sorry, because it was the itemheight, I've changed it to 30 and everything looks fine. Thank you so much... shame on me :oops:
wuscheck
Advanced
Advanced
Posts: 16
Joined: Tue Aug 26, 2003 8:07 am

Re: Including search boxes

Post by wuscheck »

I've got one more question concerning the menu. After loading the page, the corner pics on the left and right side of the menu are to big. After a mouseover the pics moved into the correct size of 9x30px. Do you have any idea about that?

Here is the code:

Code: Select all

<table border="0" cellpadding="0" cellspacing="0" align="center" id="menu">
<tr>
<td width="9" align="right" valign="top"><img src="http://www.hsghanau-handball.de/menu/images/navi_links.png" width="9" height="30" border="0"></td>
<td align="center" valign="top">

	<?
	        $mmMenu=new mMenu();
		$mmMenu->style="menuStyle";
		$mmMenu->alwaysvisible="true";
		$mmMenu->orientation="horizontal";
		$mmMenu->position="relative";
                $mmMenu->itemwidth=120;
                $mmMenu->itemheight=30;
                $mmMenu->align="center";
                $mmMenu->rawcss="background-image:url(http://www.hsghanau-handball.de/menu/images/leer.png);background-repeat:repeat-x;";
                $mmMenu->zindex="9";
		
		$mmMenu->addItemFromText("showmenu=Aktive;image=http://www.hsghanau-handball.de/menu/images/aktive.png;overimage=http://www.hsghanau-handball.de/menu/images/aktive_hover.png;imagealign=center;imageposition=top;");
			$mmMenu->addItemFromText("showmenu=Jugend;image=http://www.hsghanau-handball.de/menu/images/jugend.png;overimage=http://www.hsghanau-handball.de/menu/images/jugend_hover.png;imagealign=center;imageposition=top;");
			$mmMenu->addItemFromText("showmenu=Infos;image=http://www.hsghanau-handball.de/menu/images/infos.png;overimage=http://www.hsghanau-handball.de/menu/images/infos_hover.png;imagealign=center;imageposition=top;");
			$mmMenu->addItemFromText("showmenu=Links;image=http://www.hsghanau-handball.de/menu/images/links.png;overimage=http://www.hsghanau-handball.de/menu/images/links_hover.png;imagealign=center;imageposition=top;");
			$mmMenu->addItemFromText("showmenu=Interaktiv;image=http://www.hsghanau-handball.de/menu/images/interaktiv.png;overimage=http://www.hsghanau-handball.de/menu/images/interaktiv_hover.png;imagealign=center;imageposition=top;");			
$mmMenu->addItemFromText("text=`<form id='menu' method='get' action='http://search.atomz.com/search/'><input size='25' name='sp_q' value=''><input type='hidden' name='sp_a' value='sp10046190'><input type='hidden' name='sp_p' value='all'><input type='hidden' name='sp_f' value='ISO-8859-1'></form>`;type=form;");
$mmMenu->addItemFromText("text='+getMilonicDate()+';align=center;type=clock;itemwidth=68;");
$mmMenu->createMenu("Main Menu");
		drawMenus();
?>
</td>
<td width="9" align="left" valign="top"><img src="http://www.hsghanau-handball.de/menu/images/navi_rechts.png" width="9" height="30" border="0"></td>
</tr>
</table>
Thank you so much for the brilliant support.

wuscheck
Post Reply