View Full Version : "Quote This User Function"
LanceT
Apr 28th 2009, 10:37 pm
I need to know how to make a "Quote this User" function using script for my forum software.
Basically on my forum underneath each username will be a "Quote This User" link and that link will insert what that user posted into the text area box underneath the post.
yz4now
Apr 29th 2009, 7:52 pm
The best way would be to put what the user said in a <div></div> and assign an ID to that. Then when the users clicks "Quote This User" take the text from the DIV and transfer to the textarea.
Something like this:
<script type="text/javascript">
function transfer(){
var post = document.getElementById('user_post').innerHTML;
document.getElemenyById('new_post').value = post;
}
</script>
<div id="user_post">This is the users Post here</div>
<input type="button" onclick="transfer();" value="Quote This User" />
<textarea id="new_post"></textarea>
Sorry for my sloppy code, it is just an example.
LanceT
May 1st 2009, 1:31 am
Btw I found the typo that you wrote elemeny instead of element.
I'm also happening to use tinymce and your code only works when tinymce is disabled. Is there anyway to make it work WITH tinymce?
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.