komquat Posted May 7, 2007 Share Posted May 7, 2007 I am pulling a menu system from a DB and have a submenu, that I would like to call when I click on a link. I want to submit a form with out a submit button, or have the submit button in a link. Thanks for all the help Quote Link to comment Share on other sites More sharing options...
igor berger Posted May 7, 2007 Share Posted May 7, 2007 a link www.yourwebsite.com/yourfile.php?id1=what&id2=whatelse etc. yourfile.php <php $id1=$_GET['id1']; ?> enjoy. Quote Link to comment Share on other sites More sharing options...
komquat Posted May 7, 2007 Author Share Posted May 7, 2007 Where is a good site for learning javascript? The above is not what I am looking for. I would like to use the onclick to call a page and use information from the first page. Thanks for all the help Quote Link to comment Share on other sites More sharing options...
igor berger Posted May 7, 2007 Share Posted May 7, 2007 Google it! onclick javascript Quote Link to comment Share on other sites More sharing options...
mainewoods Posted May 8, 2007 Share Posted May 8, 2007 <a href="#" onclick="document.formname.submit();return false;">submit form</a> Quote Link to comment Share on other sites More sharing options...
komquat Posted May 8, 2007 Author Share Posted May 8, 2007 The above returns me, now how can I use the information in the form? I have some hidden values that I would like to use to do a sql search Thanks Quote Link to comment Share on other sites More sharing options...
igor berger Posted May 8, 2007 Share Posted May 8, 2007 a link www.yourwebsite.com/yourfile.php?id1=what&id2=whatelse etc. for get <form action=post> for post, look up the syntax! Quote Link to comment Share on other sites More sharing options...
komquat Posted May 8, 2007 Author Share Posted May 8, 2007 I know the syntax, it is just not working when I use the onclick to submit the form, <a href="#" onclick="document.formname.submit();return false;">submit form</a> code given earlier. Quote Link to comment Share on other sites More sharing options...
igor berger Posted May 8, 2007 Share Posted May 8, 2007 Okay! First do you want to POST or use GET? Paste your url here so can have a look. Quote Link to comment Share on other sites More sharing options...
komquat Posted May 8, 2007 Author Share Posted May 8, 2007 Here is my relavent code: 'Start of the main menu table response.write "<table align=right height=15 cellspacing=0 cellpadding=0 border=0>" response.write "<tr>" response.write "<td width=5 bgcolor=075B11 height=8> </TD>" Do while not rstmenu.EOF response.write "<form type=post id=test>" response.write "<input type=hidden name=submenu value='yes'>" response.write "<input type=hidden name=menu_id value='" & rstmenu("menu_id") & "'>" response.write "<td width=5 bgcolor=075B11 height=8><font face='Arial, Helvetica, sans-serif' color=white size=1><a href=andy_menu_trial.asp onclick='document.test.submit();return false'>" & rstmenu("menu_title") & "</a></font></td>" response.write "<td width=5 bgcolor=075b11 height=8> </TD>" response.write "</form>" rstmenu.MoveNext Loop 'Finish the table response.write "</tr>" response.write "</table>" %> </td> </tr> <tr> <td colspan=2 align=right> <% response.write request("submenu") If request("submenu") = "yes" Then '################################# '# Contains the Link Information # '################################# ' Define Connection String ' strsubcnn = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\\Smelter\Lab\DB\menu_trial.mdb;" ' Open connection ' set cnnsubmenu = server.createobject("ADODB.Connection") ' cnnsubmenu.open strsubcnn ' Set rstsubmenu = server.createobject("ADODB.recordset") ' rstsubmenu.open strsubSQL, cnnmenu 'Start of the sub menu table response.write "<table align=right height=15 cellspacing=0 cellpadding=0 border=0>" response.write "<tr>" response.write "<td width=5 bgcolor=009ACD height=8> </TD>" Do while not rstsubmenu.EOF response.write "<td width=5 bgcolor=009ACD height=8><font face='Arial, Helvetica, sans-serif' color=white size=1><a href=reports/" & rstsubmenu("submenu_link") & ">" & rstsubmenu("sub_menu") & "</a></font></td>" response.write "<td width=5 bgcolor=009ACD height=8> </TD>" rstsubmenu.MoveNext Loop 'Finish the table response.write "</tr>" response.write "</table>" End if Quote Link to comment Share on other sites More sharing options...
igor berger Posted May 8, 2007 Share Posted May 8, 2007 <form name="hotel" method="POST" action="$url_home_path/forms/process/hotel_booking.php"> <input type="Hidden" name="HotelID" value="$HotelID"> <input type="Hidden" name="permission" value="yes"> </form> <a class="contlinkor" title="Click here to send reservation request." href="javascript:document.hotel.submit();"> Here you are my dear friend, you will have to adopt it to your ASP pages! You can also use an image instead of link if you want! I had to look deap, into my closet, because I figured it out but nver used it! Why, don't you like the button? Quote Link to comment Share on other sites More sharing options...
komquat Posted May 8, 2007 Author Share Posted May 8, 2007 I am using it on a menu system and buttons do not work for it. I am trying to adapt it now, I will let you know how it turns out! Thanks Quote Link to comment Share on other sites More sharing options...
igor berger Posted May 8, 2007 Share Posted May 8, 2007 NP. You can bring some grub for my dog if it works! Quote Link to comment Share on other sites More sharing options...
komquat Posted May 8, 2007 Author Share Posted May 8, 2007 I can not get it to work, I will have to play with it when I get a little more time Quote Link to comment Share on other sites More sharing options...
komquat Posted May 8, 2007 Author Share Posted May 8, 2007 Thanks, I got it to work in php, now working with it in ASP Thanks a bunch again!! Quote Link to comment Share on other sites More sharing options...
igor berger Posted May 8, 2007 Share Posted May 8, 2007 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.