I’d like to get this right without wasting any more time on posts that seem they almost answer it, but don’t. Thanks for your help.
I want to click Book and have the value of ‘lit:’ entered or appended into a text area named Discussion in which some text already resides. Please correct my errors so my four remaining brain cells can be happy. Thank you.
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<php $m=1;?>
<Book>Book</Book>
<textarea name="Discussion[]" class="cleanup mceEditor"
id="Discussion<?php echo $m;?>"><?php echo $row_review['Discussion']; ?></textarea>
<script type="text/javascript">
$(document).ready(function(){
$("Book").click(function(){
$("#Discussion<?php echo $m;$m++;?>").val('lit:');
});
});
</script>
Assuming the only issue is that you want it to append the text instead of replacing it, you could do something like this in the onclick function:
This will append “lit:” to the textarea.