runnerjp Posted October 19, 2008 Share Posted October 19, 2008 so far i have got the code to grab a piece of text (i think) <form id="hiddenQuoteSendOff" action="index.php?page=reply&id=230" method="post" style="display:none;"> <input type="hidden" name="quote_text" value="" /> </form> <a href="#" onclick="return quoteThis();">quoteit</a> <script> function quoteThis() { var txt = ''; if (window.getSelection) { txt = window.getSelection(); } else if (document.getSelection) { txt = document.getSelection(); } else if (document.selection) { txt = document.selection.createRange().text; } else txt = ""; var hiddenForm = document.getElementById("hiddenQuoteSendOff"); hiddenForm.quote_text.value = txt; hiddenForm.submit(); return false; }</script> but one on my action page how would i paste it into a textbox allready there named inputforum... i would like it to be displayed something like [ quote] quote goes here [ /quote] Quote Link to comment https://forums.phpfreaks.com/topic/129078-posting-a-quote/ Share on other sites More sharing options...
web_loone_08 Posted October 21, 2008 Share Posted October 21, 2008 <form id="hiddenQuoteSendOff" action="index.php?page=reply&id=230" method="post" style="display:none;"> <input type="hidden" name="quote_text" value="" /> </form> <a href="#" quoteThis();">quoteit</a> <script> function quoteThis() { var txt = ''; if (window.getSelection) { txt = window.getSelection(); } else if (document.getSelection) { txt = document.getSelection(); } else if (document.selection) { txt = document.selection.createRange().text; } else txt = ""; var hiddenForm = document.getElementById("hiddenQuoteSendOff"); hiddenForm.quote_text.value = "[quote] " + txt + " [/quote]"; hiddenForm.submit(); return false; }</script> Quote Link to comment https://forums.phpfreaks.com/topic/129078-posting-a-quote/#findComment-670605 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.