Michael Biddle Posted May 3, 2009 Share Posted May 3, 2009 I am adding the following into the affiliate links: <div align="left"> <script type="text/javascript"> function SelectAll(id) { document.getElementById(id).focus(); document.getElementById(id).select(); } </script> <strong>Banner Size:</strong> 120 x 60 <br /><br /> <a href="[AffiliateLinkCode]"><img src="http://www.mysite.com/banners/120x60.gif" alt="mysite.com" border="0" /></a> <br /><br /> <strong>Source Code - Copy and Paste Into Your Website:</strong> <br /><br /> <textarea id="120x60" cols="125" rows="2" onClick="SelectAll('120x60');"><(a href="[AffiliateLinkCode]")><(img src="http://www.mysite.com/banners/120x60.gif" border="0" alt="mysite.com" /)><(/a)></textarea> <br /><br /> <strong>Banner Size:</strong> 80 x 15 <br /><br /> <a href="[AffiliateLinkCode]"><img src="http://www. mysite.com/banners/80x15.gif" alt="mysite.com" border="0" /></a> <br /><br /> <strong>Source Code - Copy and Paste Into Your Website:</strong> <br /><br /> <textarea id="80x15" cols="125" rows="2" onClick="SelectAll('80x15');"><(a href="[AffiliateLinkCode]")><(img src="http://www. mysite.com/banners/80x15.gif" border="0" alt="mysite.com" /)><(/a)></textarea> </div> After it re-saves, it is fine on the user end, but when you look back in the admin are code, it turns into: <div align="left"> <script type="text/javascript"> function SelectAll(id) { document.getElementById(id).focus(); document.getElementById(id).select(); } </script> <strong>Banner Size:</strong> 120 x 60 <br /><br /> <a href="[AffiliateLinkCode]"><img src="http://www.mysite.com/banners/120x60.gif" alt="mysite.com" border="0" /></a> <br /><br /> <strong>Source Code - Copy and Paste Into Your Website:</strong> <br /><br /> <textarea id="120x60" cols="125" rows="2" onClick="SelectAll('120x60');"><(a href="[AffiliateLinkCode]")><(img src="http://www.mysite.com/banners/120x60.gif" border="0" alt="mysite.com" /)><(/a)> Any ideas? 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted May 3, 2009 Share Posted May 3, 2009 (edited) You notice that it cut off at the closing </textarea> <textarea>...</textarea> tags cannot be used within a textarea try it like this <div align="left"> <script type="text/javascript"> function SelectAll(id) { document.getElementById(id).focus(); document.getElementById(id).select(); } </script> <strong>Banner Size:</strong> 120 x 60 <br /><br /> <a href="[AffiliateLinkCode]"><img src="http://www.mysite.com/banners/120x60.gif" alt="mysite.com" border="0" /></a> <br /><br /> <strong>Source Code - Copy and Paste Into Your Website:</strong> <br /><br /> [b]<[/b]textarea id="120x60" cols="125" rows="2" onClick="SelectAll('120x60');" [b]>[/b]<(a href="[AffiliateLinkCode]")><(img src="http://www.mysite.com/banners/120x60.gif" border="0" alt="mysite.com" /)><(/a)>[b]<[/b]/textarea [b]>[/b] <br /><br /> <strong>Banner Size:</strong> 80 x 15 <br /><br /> <a href="[AffiliateLinkCode]"><img src="http://www. mysite.com/banners/80x15.gif" alt="mysite.com" border="0" /></a> <br /><br /> <strong>Source Code - Copy and Paste Into Your Website:</strong> <br /><br /> [b]<[/b]textarea id="80x15" cols="125" rows="2" onClick="SelectAll('80x15');" [b]>[/b]<(a href="[AffiliateLinkCode]")><(img src="http://www. mysite.com/banners/80x15.gif" border="0" alt="mysite.com" /)><(/a)>[b]<[/b]/textarea [b]>[/b] </div> You will notice that when you save it the < and > will change to the normal < and > Edited May 3, 2009 by sparky 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted May 3, 2009 Share Posted May 3, 2009 Hi, I couldn't resist... here's a fix for you and anyone else that needs it. Also the highlight text java function works in both IE and FF Obvoiusly change the links to your own. (don't forget to make them https) <div align="center"> <script type="text/javascript"> function doSelectAll(d) { var textC=document.getElementById(d); if (document.selection) { //Portion for IE var div = document.body.createTextRange(); div.moveToElementText(textC); div.select(); } else { //Portion for FF var div = document.createRange(); div.setStartBefore(textC); div.setEndAfter(textC); window.getSelection().addRange(div); } } </script> <div style="border:1px solid #ccc;padding:10px;"> <div style="text-align:left;"><strong>Banner Size:</strong> 120 x 37</div> <br /> <a href="[AffiliateLinkCode]"><img src="https://tshosting.com.au/images/logo.png" style="height:37px;width:120px;" alt="tshosting.com.au" border="0" /></a> <br /><br /> <strong>Source Code - Copy and Paste Into Your Website:</strong> <div style="width:90%;height:40px;background-color:#fff;color:#000;border:2px solid #ccc;padding:3px;text-align:left;" id="120x37" onclick="doSelectAll('120x37');" ><(a href="[AffiliateLinkCode]")><(img src="http://tshosting.com.au/images/logo.png" style="height:37px;width:120px;" border="0" alt="tshosting.com.au" /)><(/a)></div> </div><br /><br /> <div style="border:1px solid #ccc;padding:10px;"> <div style="text-align:left;"><strong>Banner Size:</strong> 195 x 60</div> <br /> <a href="[AffiliateLinkCode]"><img src="https://tshosting.com.au/images/logo.png" style="height:60px;width:195px;" alt="tshosting.com.au" border="0" /></a> <br /><br /> <strong>Source Code - Copy and Paste Into Your Website:</strong> <div style="width:90%;height:40px;background-color:#fff;color:#000;border:2px solid #ccc;padding:3px;text-align:left;" id="195x60" onclick="doSelectAll('195x60');" ><(a href="[AffiliateLinkCode]")><(img src="https://tshosting.com.au/images/logo.png" style="height:60px;width:195px;" border="0" alt="tshosting.com.au" /)><(/a)></div> </div></div> 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.