Jump to content

[SOLVED] Submit Form Using Link


grungefreak

Recommended Posts

I want to submit a form using a link. I am writing the code within an "echo" as follows:

	$title  = mysql_result($result,$i,"title");
		$isbn   = mysql_result($result,$i,"isbn");


		echo "<form action='prod_info.php' method='post'>";
		echo "<table style: border = 1><tr><td style: width='200px'><a href = '#' onclick = 'this.form.submit()'>" .$title. "</a></td></tr>";
		echo "</table></form>";

 

It's not submitting the form though. any ideas?

 

JH

 

Link to comment
https://forums.phpfreaks.com/topic/165251-solved-submit-form-using-link/
Share on other sites

I want to submit a form using a link. I am writing the code within an "echo" as follows:

	$title  = mysql_result($result,$i,"title");
		$isbn   = mysql_result($result,$i,"isbn");


		echo "<form action='prod_info.php' method='post'>";
		echo "<table style: border = 1><tr><td style: width='200px'><a href = '#' onclick = 'this.form.submit()'>" .$title. "</a></td></tr>";
		echo "</table></form>";

 

It's not submitting the form though. any ideas?

 

JH

 

<a href = '#' [code]onclick = 'this.form.submit()'

>[/code]

Thats a javascript function right? I think your problem lyes in there...

i believe it has to have the name of the form

 


<form name="myform" action="prod_info.php" method="post">

<a href="#" onclick="document.myform.submit();">GOGOGO</a>

</form>

 

but there is a js board

 

http://www.phpfreaks.com/forums/index.php/board,6.0.html

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.