grungefreak Posted July 8, 2009 Share Posted July 8, 2009 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 More sharing options...
cs.punk Posted July 8, 2009 Share Posted July 8, 2009 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... Link to comment https://forums.phpfreaks.com/topic/165251-solved-submit-form-using-link/#findComment-871485 Share on other sites More sharing options...
grungefreak Posted July 8, 2009 Author Share Posted July 8, 2009 Yes, but it seems like it's right. Does anybody know if it's wrong? GF Link to comment https://forums.phpfreaks.com/topic/165251-solved-submit-form-using-link/#findComment-871488 Share on other sites More sharing options...
cunoodle2 Posted July 8, 2009 Share Posted July 8, 2009 Yeah it's wrong as it is not working. Link to comment https://forums.phpfreaks.com/topic/165251-solved-submit-form-using-link/#findComment-871490 Share on other sites More sharing options...
grungefreak Posted July 8, 2009 Author Share Posted July 8, 2009 err... i know that. any other advice? jh Link to comment https://forums.phpfreaks.com/topic/165251-solved-submit-form-using-link/#findComment-871496 Share on other sites More sharing options...
seventheyejosh Posted July 8, 2009 Share Posted July 8, 2009 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 Link to comment https://forums.phpfreaks.com/topic/165251-solved-submit-form-using-link/#findComment-871502 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.