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:19
Submit form
Poster: php __at__ madmonkey.co.za
Dated: Friday July 16 2004 - 0:17:22 BST
Why is the form.submit('this') not working from the menu_data.js?
Poster: php __at__ madmonkey.co.za
Dated: Friday July 16 2004 - 7:21:15 BST
This is not working
aI("text=Search;url=javascript:form.submit('this');");
Poster: Maz
Dated: Friday July 16 2004 - 17:02:30 BST
I'm not sure I understand what you are trying to do with this.
If you are trying to add a search box then that is incorrect.
But I can tell you how to do that, in
text=<form></form>;type=form;
There is a search form in the beginners section of the forum.
Either way you can let us know if you still have a problem.
maz
Re: Submit form
Poster: kevin3442
Dated: Friday July 16 2004 - 20:01:46 BST
Hi,
php __at__ madmonkey.co.za wrote:
This is not working
aI("text=Search;url=javascript:form.submit('this');");
aI("text=Search;url=javascript:form.submit('this');");
Just some syntax problems in the javascript; the submit() method doesn't take a parameter, and in this context 'this' is an object rather than a literal string as you have it. You probably mean
Code:
this.form.submit()
Of course, that'll only work if the menu is defined inside of the form you want to submit. If that's the case, this.form should be implied and you'll probably find that a simple
Code:
submit()
works just as well.
Hope that helps,
Kevin
Poster: php __at__ madmonkey.co.za
Dated: Monday July 19 2004 - 20:45:00 BST
In my search_data.js
Code:
with(milonic=new menuname("Main Menu")){
style=XPMainStyle;
menuwidth="100%";
menualign="left";
alwaysvisible=1;
orientation="horizontal";
margin=4;
aI("text=Back;url=back.php;");
aI("text=Search;submit();");
aI("text=Cancel;url=list.php");
}
style=XPMainStyle;
menuwidth="100%";
menualign="left";
alwaysvisible=1;
orientation="horizontal";
margin=4;
aI("text=Back;url=back.php;");
aI("text=Search;submit();");
aI("text=Cancel;url=list.php");
}
In my searchit.php
Code:
<html>
<head>
<title>Search</title>
<style>BODY{background-color:#EFEDDE;}</style>
</head>
<body>
<form method="POST" action="searchit.php">
<p>VMS #:
<input type="text" name="stVMS" size="20" class=edit>
<p>
<SCRIPT language=JavaScript src="milonic_src.js" type=text/javascript></SCRIPT>
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
</script>
<SCRIPT language=JavaScript src="search_data.js" type=text/javascript></SCRIPT>
</form>
</body>
</html>
<head>
<title>Search</title>
<style>BODY{background-color:#EFEDDE;}</style>
</head>
<body>
<form method="POST" action="searchit.php">
<p>VMS #:
<input type="text" name="stVMS" size="20" class=edit>
<p>
<SCRIPT language=JavaScript src="milonic_src.js" type=text/javascript></SCRIPT>
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
</script>
<SCRIPT language=JavaScript src="search_data.js" type=text/javascript></SCRIPT>
</form>
</body>
</html>
When you click on the menu button you will get a "Object excpected".
Thank You
Poster: Ruth
Dated: Monday July 19 2004 - 21:54:29 BST
I don't know doing forms, but I copied and pasted your code and what I get when I look at the menu on the page is
Code:
Back | Search;submit() | Cancel
so what you put there is rendering as text. Is it supposed to be Code:
aI("text=Search;url=submit();");
Ruth
Poster: Maz
Dated: Monday July 19 2004 - 23:45:29 BST
I don't understand, if you want to go to the search page then the url is search.php maybe I don't understand the js not telling where to search.
I don't think you can put the menu inside a search form, that just looks wrong to me.
You can put the search inside text= and maybe even use javascript= then type=form
Once we figure out exactly what you are trying to do maybe someone can figure out the js.
maz
Poster: php __at__ madmonkey.co.za
Dated: Tuesday July 20 2004 - 11:01:49 BST
Menu item should look like
Code:
aI("text=Search;url=javascript:submit();");
What I want to do is when you click on the search button it will submit the form
Poster: John
Dated: Tuesday July 20 2004 - 15:26:38 BST
I agree with Maz. I don't understand why the JS calls to the menu are inside the form.
Poster: php __at__ madmonkey.co.za
Dated: Thursday July 22 2004 - 10:01:16 BST
The js calls is not in the form.
My menu_data.js file:
Code:
_menuCloseDelay=500 // The time delay for menus to remain visible on mouse out
_menuOpenDelay=150 // The time delay before menus open on mouse over
_subOffsetTop=2 // Sub menu top offset
_subOffsetLeft=-10 // Sub menu left offset
with(XPMainStyle=new mm_style()){
onbgcolor="#C1D2EE";
oncolor="#000000";
offbgcolor="#EFEDDE";
offcolor="#000000";
bordercolor="#8A867A";
borderstyle="solid";
borderwidth=0;
separatorcolor="#EFEDDE";
separatorsize="15";
padding=3;
fontsize="75%";
fontstyle="normal";
fontweight="normal";
fontfamily="Tahoma,Helvetica,Verdana";
subimagepadding="2";
onborder="1px solid #316AC5";
offborder="1px solid #cccccc";
}
with(XPMenuStyle=new mm_style()){
onbgcolor="#C1D2EE";
oncolor="#000000";
offbgcolor="transparent";
offcolor="#000000";
bordercolor="#8A867A";
borderstyle="solid";
borderwidth=1;
separatorcolor="#8A867A";
separatorpadding="2";
separatoralign="right";
separatorwidth="100%";
padding=3;
fontsize="75%";
fontstyle="normal";
fontweight="normal";
fontfamily="Tahoma,Helvetica,Verdana";
image="xpblank.gif";
subimage="arrow.gif";
onborder="1px solid #316AC5";
overfilter="Fade(duration=0.3);Alpha(opacity=90);Shadow(color='#777777', Direction=135, Strength=5)";
outfilter="randomdissolve(duration=0.5)";
menubgimage="winxp.gif";
}
with(milonic=new menuname("Main Menu")){
style=XPMainStyle;
menuwidth="100%";
menualign="left";
alwaysvisible=1;
orientation="horizontal";
margin=4;
aI("text=Back;url=back.php;");
aI("text=Search;url=javascript:submit();");
aI("text=Cancel;url=list.php");
}
drawMenus();
_menuOpenDelay=150 // The time delay before menus open on mouse over
_subOffsetTop=2 // Sub menu top offset
_subOffsetLeft=-10 // Sub menu left offset
with(XPMainStyle=new mm_style()){
onbgcolor="#C1D2EE";
oncolor="#000000";
offbgcolor="#EFEDDE";
offcolor="#000000";
bordercolor="#8A867A";
borderstyle="solid";
borderwidth=0;
separatorcolor="#EFEDDE";
separatorsize="15";
padding=3;
fontsize="75%";
fontstyle="normal";
fontweight="normal";
fontfamily="Tahoma,Helvetica,Verdana";
subimagepadding="2";
onborder="1px solid #316AC5";
offborder="1px solid #cccccc";
}
with(XPMenuStyle=new mm_style()){
onbgcolor="#C1D2EE";
oncolor="#000000";
offbgcolor="transparent";
offcolor="#000000";
bordercolor="#8A867A";
borderstyle="solid";
borderwidth=1;
separatorcolor="#8A867A";
separatorpadding="2";
separatoralign="right";
separatorwidth="100%";
padding=3;
fontsize="75%";
fontstyle="normal";
fontweight="normal";
fontfamily="Tahoma,Helvetica,Verdana";
image="xpblank.gif";
subimage="arrow.gif";
onborder="1px solid #316AC5";
overfilter="Fade(duration=0.3);Alpha(opacity=90);Shadow(color='#777777', Direction=135, Strength=5)";
outfilter="randomdissolve(duration=0.5)";
menubgimage="winxp.gif";
}
with(milonic=new menuname("Main Menu")){
style=XPMainStyle;
menuwidth="100%";
menualign="left";
alwaysvisible=1;
orientation="horizontal";
margin=4;
aI("text=Back;url=back.php;");
aI("text=Search;url=javascript:submit();");
aI("text=Cancel;url=list.php");
}
drawMenus();
My search.php file
Code:
<html>
<head>
<title>Search</title>
<style>BODY{background-color:#EFEDDE;}</style>
</head>
<body>
<form method="POST" action="searchit.php">
<p>VMS #:
<input type="text" name="stVMS" size="20">
<p>
<SCRIPT language=JavaScript src="milonic_src.js" type=text/javascript></SCRIPT>
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
</script>
<SCRIPT language=JavaScript src="menu_data.js" type=text/javascript></SCRIPT>
</form>
</body>
</html>
<head>
<title>Search</title>
<style>BODY{background-color:#EFEDDE;}</style>
</head>
<body>
<form method="POST" action="searchit.php">
<p>VMS #:
<input type="text" name="stVMS" size="20">
<p>
<SCRIPT language=JavaScript src="milonic_src.js" type=text/javascript></SCRIPT>
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
</script>
<SCRIPT language=JavaScript src="menu_data.js" type=text/javascript></SCRIPT>
</form>
</body>
</html>
I found another way to get the result I wanted
My mybutton.htm file.
Code:
<html>
<head>
<style>
BODY{
background: #EFEDDE;
}
a.button{
color: #000000;
background: #EFEDDE;
border: 2px outset;
text-align : center;
font-family: Tahoma,Helvetica,Verdana;
font-style : normal ;
font-size : 8pt;
font-weight :normal;
color :#000000;
padding: 3px 4px;
text-align: center;
text-decoration: none;
}
a.button:hover{
background-color: #C1D2EE;
border-style: outset;
border-color: #316AC5;
border-width: 2px;
color :#000000;
}
</style>
<title>New Page 1</title>
</head>
<body>
<form method="POST" action="mybutton.htm">
<a class="button" href="#" onClick="submit();">My button</a>
</form>
</body>
</html>
<head>
<style>
BODY{
background: #EFEDDE;
}
a.button{
color: #000000;
background: #EFEDDE;
border: 2px outset;
text-align : center;
font-family: Tahoma,Helvetica,Verdana;
font-style : normal ;
font-size : 8pt;
font-weight :normal;
color :#000000;
padding: 3px 4px;
text-align: center;
text-decoration: none;
}
a.button:hover{
background-color: #C1D2EE;
border-style: outset;
border-color: #316AC5;
border-width: 2px;
color :#000000;
}
</style>
<title>New Page 1</title>
</head>
<body>
<form method="POST" action="mybutton.htm">
<a class="button" href="#" onClick="submit();">My button</a>
</form>
</body>
</html>
Poster: John
Dated: Thursday July 22 2004 - 15:14:17 BST
php __at__ madmonkey.co.za wrote:
The js calls is not in the form.
Then this has me confused (which is sometimes easy to do)...
php __at__ madmonkey.co.za wrote:
My search.php file
Code:
<html>
<head>
<title>Search</title>
<style>BODY{background-color:#EFEDDE;}</style>
</head>
<body>
<form method="POST" action="searchit.php">
<p>VMS #:
<input type="text" name="stVMS" size="20">
<p>
<SCRIPT language=JavaScript src="milonic_src.js" type=text/javascript></SCRIPT>
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
</script>
<SCRIPT language=JavaScript src="menu_data.js" type=text/javascript></SCRIPT>
</form>
</body>
</html>
<head>
<title>Search</title>
<style>BODY{background-color:#EFEDDE;}</style>
</head>
<body>
<form method="POST" action="searchit.php">
<p>VMS #:
<input type="text" name="stVMS" size="20">
<p>
<SCRIPT language=JavaScript src="milonic_src.js" type=text/javascript></SCRIPT>
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
</script>
<SCRIPT language=JavaScript src="menu_data.js" type=text/javascript></SCRIPT>
</form>
</body>
</html>