Submit form
-
- Beginner
- Posts: 5
- Joined: Fri Jul 16, 2004 12:13 am
Submit form
Why is the form.submit('this') not working from the menu_data.js?
-
- Beginner
- Posts: 5
- Joined: Fri Jul 16, 2004 12:13 am
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
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
Hi,
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
works just as well.
Hope that helps,
Kevin
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 meanphp@madmonkey.co.za wrote:This is not working
aI("text=Search;url=javascript:form.submit('this');");
Code: Select all
this.form.submit()
Code: Select all
submit()
Hope that helps,
Kevin
-
- Beginner
- Posts: 5
- Joined: Fri Jul 16, 2004 12:13 am
In my search_data.js
In my searchit.php
When you click on the menu button you will get a "Object excpected".
Thank You
Code: Select all
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");
}
Code: Select all
<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>
Thank You
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 so what you put there is rendering as text. Is it supposed to be
Ruth
Code: Select all
Back | Search;submit() | Cancel
Code: Select all
aI("text=Search;url=submit();");
Ruth
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
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
-
- Beginner
- Posts: 5
- Joined: Fri Jul 16, 2004 12:13 am
Menu item should look like
What I want to do is when you click on the search button it will submit the form
Code: Select all
aI("text=Search;url=javascript:submit();");
-
- Beginner
- Posts: 5
- Joined: Fri Jul 16, 2004 12:13 am
The js calls is not in the form.
My menu_data.js file:
My search.php file
I found another way to get the result I wanted
My mybutton.htm file.
My menu_data.js file:
Code: Select all
_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();
Code: Select all
<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>
My mybutton.htm file.
Code: Select all
<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>
Then this has me confused (which is sometimes easy to do)...php@madmonkey.co.za wrote:The js calls is not in the form.
php@madmonkey.co.za wrote:My search.php fileCode: Select all
<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>
John