Help embeding a form tag into a menu entry

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
ripnoel
Super Advanced
Super Advanced
Posts: 50
Joined: Tue Jan 21, 2003 4:15 am
Location: Foothills of The Great Smoky Mtns.

Help embeding a form tag into a menu entry

Post by ripnoel »

Could someone please show me the correct way to get the following code into Melonic 5? I have tried switching all the double quotes to single and also tried escaping (\') but Melonic still renders a blank entry. Help appreciated. Rip
---------------------------------------


<form action="shopsearch.asp?search=Yes" method="post" id=form3 name=form3>
&nbsp;<input name="B1" type="submit" value="Search Store" class="submit-text">
<br>
&nbsp;
<input type="text" name="keyword" CLASS="input-text">
</form>

----------------------------------------
example URL: http://www.alicemooregallery.com/store/default3.htm

Here is my example escaping and also stripping out the class:
-----------------------------------
aI("text=<form action=\'shopsearch.asp?search=Yes\' method=\'post\' id=form3 name=form3>&nbsp;<input name=\'B1\' type=\'submit\' value=\'Search Store\'><br>&nbsp;<input type=\'text\' name=\'keyword\'></form>;type=form;");
-------------------------------------
help appreciated!
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

I'm not up on forms, but have you tried checking out the Beginner's Guide? Maz did a section about putting forms into a menu item.

Ruth
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

The best way is to strip all the quotes, you can do that with your code without causing problems.

Mac ie appears to be the only browser that doesn't like quotes as far as I can tell.

maz
ripnoel
Super Advanced
Super Advanced
Posts: 50
Joined: Tue Jan 21, 2003 4:15 am
Location: Foothills of The Great Smoky Mtns.

Thanks. That worked but I have a extra space after form ele?

Post by ripnoel »

Thanks Ruth & Maz,

Here is my stripped code:

aI("text=<form action=shopsearch.asp?search=Yes method=post id=form3 name=form3><input name=B1 type=submit value=Search Store class=submit-text><br><input type=text name=keyword CLASS=input-text></form>;type=form;");
aI("text=<form action=shoplogin.asp method=post><input type=hidden name=returnurl value=shopdisplaycategories.asp><span CLASS=text-white>Client Login</span><br><span CLASS=text-white-bold>Last Name<br></span><input type=text name=strlastname CLASS=input-text><br><span CLASS=text-white-bold>Email</span><br><input type=text name=stremail CLASS=input-text><br><input name=L1 type=submit value=Login CLASS=submit-text></form>;type=form;");

which works fine but I now have an extra line after each form element in my menu which is making it too long on some pages. Here is the URL: http://www.alicemooregallery.com/store/
Do you think this possibly could be caused by the width of the input area?

Thanks again,

Rip
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

yes, I've had the same problem, every browser has its own way of handling form fields that often takes some workarounds.

One way is to take if off the main menu and make it its own separate menu item, useing background transparent can hide the size, then it won't change the main menu by browser.

Although your spacing is the complete opposite of my spacing so there probably is hope yet. Try adding after type=form;padding=0;

maz
ripnoel
Super Advanced
Super Advanced
Posts: 50
Joined: Tue Jan 21, 2003 4:15 am
Location: Foothills of The Great Smoky Mtns.

Good workaround! But now I have a scrolling menu problem

Post by ripnoel »

Hi Maz:

Thanks for your seperate menu suggestion. That will work well for this usage. Unfortunately adding "padding=0;" did not correct the problem.

I do want my menus to scroll and now when I do so they accordion up onto each other. The top menu starts to scroll down before the second one. See example of this problem at: http://www.alicemooregallery.com/store/ ... raphic+Art

Do you know how to possible prevent these menus from overlapping?

THX

Rip
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi Rip,

Nice to see another repeat Milonic Menu user back in the forums. I don't think Maz will mind if I jump in.

If I were you, in "Main Menu" I'd set:

Code: Select all

followscroll="0,40,10";
By using 0 instead of 1 as the starting point for scroll following, you'll eliminate the 1px space between the top of the Main Menu and the top of the viewable area that you currently have.

In "searchMenu" I'd also change top=287; to top=288; because it looks like the top of your "Search" button is overlapping the bottom of the Main Menu by about 1px. Having done that, we'll whip out a little math. Since your Main Menu is at top=140 and your searchMenu is at top=288... 288 - 140 = 148, so we'll use that as the starting point to start the scroll following for the "searchMenu". So, in "searchMenu" set

Code: Select all

followscroll="148,40,10";
I prefer the three-parameter approach to setting followscroll because (1) you can eliminate the 1px gap at the top and (2) you can control the scroll rate. You'll find a more detailed explanation of the various settings used in followscroll in this post.

BTW... nice looking site design, as always.

Hope that helps,

Kevin
Post Reply