EchoFool Posted May 16, 2009 Share Posted May 16, 2009 Can href links that are displayed in a form, in anyway count as a $_POST when clicked..or is it always 100% _GET with hrefs when using ?test&var=1 etc ? Is there a way to use post in hrefs? Not that i need to just wanted to know if it was at all possible. Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted May 16, 2009 Share Posted May 16, 2009 You can use an onclick function to send POST data, but otherwise, it'll just be GET. Quote Link to comment Share on other sites More sharing options...
EchoFool Posted May 16, 2009 Author Share Posted May 16, 2009 Isn't that JS language that does that? Or is that html ? Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted May 16, 2009 Share Posted May 16, 2009 That is JavaScript. AJAX specifically, unless you want the link's onclick function to just submit the form with POST method. Quote Link to comment Share on other sites More sharing options...
EchoFool Posted May 16, 2009 Author Share Posted May 16, 2009 Ok thanks Ken, i will have a fiddle with the onclick function! Thank you! Quote Link to comment Share on other sites More sharing options...
.josh Posted May 16, 2009 Share Posted May 16, 2009 <script language="Javascript"> function submitInfo(x) { document.getElementById('someField').value = x; document.getElementById('someForm').submit(); } </script> <a href='javascript: void(0);' onclick="submitInfo('someValue');">do something</a> <form id='someForm' method='post' action='someplace.php'> <input type='hidden' id='someField' name='someField' value='' /> </form> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.