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 Link to comment https://forums.phpfreaks.com/topic/50400-solved-using-a-link-to-submit-a-form/ 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. Link to comment https://forums.phpfreaks.com/topic/50400-solved-using-a-link-to-submit-a-form/#findComment-247540 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 Link to comment https://forums.phpfreaks.com/topic/50400-solved-using-a-link-to-submit-a-form/#findComment-247588 Share on other sites More sharing options...
igor berger Posted May 7, 2007 Share Posted May 7, 2007 Google it! onclick javascript Link to comment https://forums.phpfreaks.com/topic/50400-solved-using-a-link-to-submit-a-form/#findComment-247652 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> Link to comment https://forums.phpfreaks.com/topic/50400-solved-using-a-link-to-submit-a-form/#findComment-247777 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 Link to comment https://forums.phpfreaks.com/topic/50400-solved-using-a-link-to-submit-a-form/#findComment-248000 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! Link to comment https://forums.phpfreaks.com/topic/50400-solved-using-a-link-to-submit-a-form/#findComment-248009 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. Link to comment https://forums.phpfreaks.com/topic/50400-solved-using-a-link-to-submit-a-form/#findComment-248057 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. Link to comment https://forums.phpfreaks.com/topic/50400-solved-using-a-link-to-submit-a-form/#findComment-248068 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 Link to comment https://forums.phpfreaks.com/topic/50400-solved-using-a-link-to-submit-a-form/#findComment-248088 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? Link to comment https://forums.phpfreaks.com/topic/50400-solved-using-a-link-to-submit-a-form/#findComment-248097 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 Link to comment https://forums.phpfreaks.com/topic/50400-solved-using-a-link-to-submit-a-form/#findComment-248099 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! Link to comment https://forums.phpfreaks.com/topic/50400-solved-using-a-link-to-submit-a-form/#findComment-248101 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 Link to comment https://forums.phpfreaks.com/topic/50400-solved-using-a-link-to-submit-a-form/#findComment-248116 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!! Link to comment https://forums.phpfreaks.com/topic/50400-solved-using-a-link-to-submit-a-form/#findComment-248509 Share on other sites More sharing options...
igor berger Posted May 8, 2007 Share Posted May 8, 2007 Link to comment https://forums.phpfreaks.com/topic/50400-solved-using-a-link-to-submit-a-form/#findComment-248529 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.