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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.