MasterACE14 Posted January 27, 2008 Share Posted January 27, 2008 hello everyone, I have a small script I had been using by itself to submit a form by pressing a hyperlink(which is javascript) but I need to using it on the page I am currently working on, and I am putting all HTML and javascript in PHP echo's and I believe I have concocted the PHP within the echo's and PHP incorrectly. When I press one of the hyperlinks, it doesn't do anything, or doesn't submit the form. here's the script: <?php echo "<form method=\"post\" action=\"index.php?page=player_interaction\" name=\"otherplayersid_" . $row['sender_id'] . " id=\"otherplayersid_" . $row['sender_id'] . ">"; echo "<input type=\"hidden\" name=\"otherplayersid\" value=" . $row['sender_id'] . ">"; echo "<td><center><a href=\"javascript:document.otherplayersid_" . $row['sender_id'] . ".submit();\">" . $row['sender_name'] . "</a></center></td>"; echo "</form>"; ?> here's the original script on the other page: <form id="otherplayersid_<?php echo $all_id;?>" method="post" name="otherplayersid_<?php echo $all_id;?>" action="http://www.crikeygames.com.au/conflictingforces/index.php?page=player_interaction"> <input type="hidden" name="otherplayersid" value="<?=$all_id ?>"> </form> any help is greatly appreciated. Regards ACE Link to comment https://forums.phpfreaks.com/topic/87987-solved-not-submitting-form-with-javascript-suspected-problem-within-php-echo/ Share on other sites More sharing options...
MasterACE14 Posted January 27, 2008 Author Share Posted January 27, 2008 bump Link to comment https://forums.phpfreaks.com/topic/87987-solved-not-submitting-form-with-javascript-suspected-problem-within-php-echo/#findComment-450231 Share on other sites More sharing options...
MasterACE14 Posted January 27, 2008 Author Share Posted January 27, 2008 anyone know what I'm doing wrong? Link to comment https://forums.phpfreaks.com/topic/87987-solved-not-submitting-form-with-javascript-suspected-problem-within-php-echo/#findComment-450318 Share on other sites More sharing options...
Barand Posted January 27, 2008 Share Posted January 27, 2008 running your code then viewing the HTML source that it produced showed <form method="post" action="index.php?page=player_interaction" name="otherplayersid_ id="otherplayersid_> A couple of missing quotes (You could heve done this in less time that it took to post and bump). Link to comment https://forums.phpfreaks.com/topic/87987-solved-not-submitting-form-with-javascript-suspected-problem-within-php-echo/#findComment-450377 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.