Jump to content

[SOLVED] Using a link to submit a form??


komquat

Recommended Posts

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
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

<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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.