Jump to content

posting a quote..


runnerjp

Recommended Posts

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]

Link to comment
https://forums.phpfreaks.com/topic/129078-posting-a-quote/
Share on other sites

<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>

Link to comment
https://forums.phpfreaks.com/topic/129078-posting-a-quote/#findComment-670605
Share on other sites

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.