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:52

Textbox and button

Poster: ironz
Dated: Saturday December 13 2003 - 19:59:20 GMT


i just want a simple login [textbox-button] in my menu [Xpstyle menu]

i search on the forum but all code i found are not working.

i also try this:

aI("text=<FORM NAME="UserInfo">Chat on QSC channel! Enter your Nickname:<input TYPE=TEXT NAME="NICKNAME" SIZE=12><INPUT TYPE="BUTTON" VALUE="Go!" onClick="send()">;url=;image=irc.jpg;separatorsize=2;");

this code don't work and crash the menu

thx for help

Poster: John
Dated: Sunday December 14 2003 - 0:54:46 GMT

Lots of examples from doing a search. A start could be...
aI("text=`<form method=post action=whatever.html>...form data, input, submit, etc. ...</form>`;type=form;");

Poster: ironz
Dated: Monday December 22 2003 - 4:30:26 GMT

ok , i know i'm nub on html form but your code don't work.

aI("text=`<form method=post action=whatever.html>=<FORM NAME="UserInfo">Chat on QSC channel! Enter your Nickname:<input TYPE=TEXT NAME="NICKNAME" SIZE=12><INPUT TYPE="BUTTON" VALUE="Go!" onClick="send()"</form>`;type=form;");

i got a javascript error on my web page and the menu won't load

Poster: John
Dated: Monday December 22 2003 - 16:15:38 GMT

ironz wrote:
ok , i know i'm nub on html form but your code don't work.

There's a lot of code on the board that does work, and, if you did search for it, it would appear you're not paying attention to what you're finding.

At any rate, we're not here to teach basic HTML. If you don't know that you won't get anywhere with the menu (or with posting sites, for that matter).

However, I will point a few things wrong with your code...

1. You have <form> in there twice. Why? Can't do that.

2. You have an '=' between the two <form> tags. Why? Can't do that, either.

I would strongly suggest learning your basic HTML, then worry about the menu.

Poster: ironz
Dated: Monday December 22 2003 - 20:58:35 GMT

lol? k php / mysql is better than html.

Anyways html is a very "bastard" language.u know like qbasic in prog :).

Poster: ironz
Dated: Monday December 22 2003 - 21:07:26 GMT

ok, this is my REAL script that i try to convert to fit in the menu.

in my php page :

<script language="JavaScript" src="popup.js">
<FORM NAME="UserInfo">
<TD align=right><font color="#990000"><u>Chattez live sur IRC QSC! Entrez votre Nickname:</u></font></TD>
<INPUT TYPE="BUTTON" VALUE="Go!" onClick="send()"><TD>

Sorry but THIS code work perfectly !!! but not in the MILONIC MENU !

Poster: Hergio
Dated: Saturday January 3 2004 - 16:58:26 GMT

Agreed! HTML is a bastard language, mainly because its just a markup language and developers have taught browsers to ignore things they dont understand so you could put almost anything in a page without blowing it up. But we are slowing moving in the right directions with XHTML standards and technologies such as ASP.NET. Looking at the code in your page, its not right either, your point exactly ;) You have a form element when its not really necessary because you are taking care of the submitting yourself by catching the onClick you dont close the form element and you have the Go Button stuck outside a table cell, that really should be inside of TD tags...anyways enough ranting.

If you'd like to put that code in a menu item its very possible. As you will notice, there is a search menu item on the Milonic homepage. Looking at the source code for that you will see how its done...(all on one line)
aI("text=<FORM METHOD=GET ACTION=/search.php name=search><table><tr><td>Search Milonic</td></tr><tr><td><input name=q size=11></td></tr><tr><td><input type=submit value=Search></td></tr></table></form>;type=form;align=center;onbgcolor=;onborder=;");

Now we can try and port this with your code...remember, you need to keep tabs on quotes and escape things as necessary....(all on one line)
aI("text=<FORM name=userinfo><table><tr><td align=right><font color='#990000'><u>Chattez live sur IRC QSC! Entrez votre Nickname:</u></font></td><td><input type=text name=nickname  size=12></td><td><input type=button  value='Go!' onClick='send()'></td></tr></table></form>;type=form;");

Notice I cleaned it up alittle, you need to put the ENTIRE menu item within its own self contained table because the menu itself is made of of tables and cells and if you just paste TDs and TRs into the text of a menu item it will screw with things. Also you can use single quotes in the menu text as I did, but no double quotes without escaping them. Also to put a form in a menu item you need that type=form on the end.

I did not test this code, but its definitely in the right with this. Hope it helps.

Poster: Maz
Dated: Saturday January 3 2004 - 18:14:36 GMT

I posted in the bugs section, about this, the " or ' don't work as posted in the example, take those out and the form works fine.


Poster: Hergio
Dated: Saturday January 3 2004 - 18:32:20 GMT

The double quotes obviously dont work, thats because you cant have double quotes inside of a string in javascript without escaping them. And the whole thing inside the aI is a string so any double quotes must be escaped or removed. The single quotes however should work..I've gotten them to work inside of strings forever. Not sure why they wouldnt work.