Textbox and button

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
ironz
Beginner
Beginner
Posts: 4
Joined: Sat Dec 13, 2003 8:53 pm

Textbox and button

Post by ironz »

Hi,

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:

Code: Select all

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
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Lots of examples from doing a search. A start could be...

Code: Select all

aI("text=`<form method=post action=whatever.html>...form data, input, submit, etc. ...</form>`;type=form;");
John
ironz
Beginner
Beginner
Posts: 4
Joined: Sat Dec 13, 2003 8:53 pm

Post by ironz »

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

Code: Select all

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
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

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.
John
ironz
Beginner
Beginner
Posts: 4
Joined: Sat Dec 13, 2003 8:53 pm

Post by ironz »

lol? k php / mysql is better than html.

Anyways html is a very "bastard" language.u know like qbasic in prog :).
ironz
Beginner
Beginner
Posts: 4
Joined: Sat Dec 13, 2003 8:53 pm

Post by ironz »

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

in my php page :

Code: Select all

<script language="JavaScript" src="popup.js">
</script>
<FORM NAME="UserInfo">
<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>
<INPUT TYPE="BUTTON" VALUE="Go!" onClick="send()"><TD>
<TR>
Sorry but THIS code work perfectly !!! but not in the MILONIC MENU !
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

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 event...plus 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)

Code: Select all

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)

Code: Select all

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 direction...work with this. Hope it helps.
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

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.

Regards,
maz
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

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.
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
Post Reply