Need Help Incorporating HTML Form Code

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
Ralls
Advanced
Advanced
Posts: 16
Joined: Wed Jan 24, 2007 9:37 am

Need Help Incorporating HTML Form Code

Post by Ralls »

I'm trying to incorporate the following HTML "form" code into an aI menu element:

<input name="terms" type="text" onFocus="this.value=''; this.style.backgroundImage='none'; this.style.paddingLeft=0" value="Search" size="18" maxlength="50" class="Search" />

The above code works fine in HTML, but I can't seem to find the correct way to code it in the menu aI element so that it works. Any help would be greatly appreciated. Thanks.
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Re: Need Help Incorporating HTML Form Code

Post by Andy »

Hi,

What's happening is you are including semi-colons and equals signs which is confusing the menu parser. What you need to do is enclose the HTML inside backquotes, this means the menu will know NOT to parse the HTML.

You also have double quotes and these too will confuse the parser so what you need to do there is escape the double quotes with the escape character.

Here's the form object that should work:

Code: Select all

aI("text=`<input name=terms type=text onFocus=\"this.value=''; this.style.backgroundImage='none'; this.style.paddingLeft=0\" value=Search size=18 maxlength=50 class=Search />`;type=form");
Hope this helps,
Andy
Post Reply