Hi Claire,
Sorry to revisit this but I've been out of the office for about a month.
Using the global /g I managed to get all of the <br> to be removed, but they are not being replaced by anything, which when I paste the clipboard, renders one line of email addresses with no line breaks and no space between addresses.
You can see the result at http://ericaminer.com/emaillistB.php Log in with the Cookbook credentials that I sent you.
Here's the code I'm using (just in case I made a mistake somewhere)
<script>
function copylist(id)
{
var divcontents = document.getElementById('list'+id);
var text = divcontents.innerHTML;
var finaltext = text.replace(/<br>/g,"\n");
window.prompt("Copy to Clipboard: CMD (CTL) +C To Copy - Press OK", finaltext);
}
</script>
And where I call the function:
<div align="left" class="copyright">
<button style="background:#7f0000" onclick="copylist(1)">Click To Select This List - CMD (CTL) +C To Copy - Press OK</button>
<br />
<div id="list1"><?php foreach ($email_signupRecords as $record): ?><?php if (($record['email'] && $record['hidden'] == 0 && $record['confirmed'] == 1) && ($record['remove']== 0 || $record['remove']== "")): ?><?php echo ($record['email']) ?><br><?php endif ?><?php endforeach ?></div>
Thanks,
Jerry Kornbluth
The first CMS Builder reference book is now available on-line!
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php