Re: Including javascript (or php) within text area
Hi,
You won't be able to include JavaScript into the page within a TEXTAREA tag as all markup between those tags is displayed "asis", as you've discovered...
The first way I can think of to do this is to use JavaScript to update the text, substituting a placeholder (that you write in when generating the page) with document.title.
Try this:
Code:
<p class="likeit">Link to this page: <textarea id="codearea" name="codearea" rows="6" cols="60"><a href="<?php echo curPageURL();?>" target="_blank">TITLE</a></textarea></p>
<script type='text/javascript'>
document.getElementById('codearea').innerHTML = document.getElementById('codearea').innerHTML.replace(/TITLE/,document.title);
</script>
Re: Including javascript (or php) within text area
Haha, it doesn't matter whether it's here or the PT forums - you still answer extremely quickly and with a solution that works
Sir, you are a genius and a star. Thanks very much!