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:16
Need Help Incorporating HTML Form Code
Poster: Ralls
Dated: Saturday September 20 2008 - 13:01:23 BST
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.
Re: Need Help Incorporating HTML Form Code
Poster: Andy
Dated: Monday September 22 2008 - 10:05:21 BST
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:
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