Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Select all in [code] and [php]
#31
have you tried my plugin which i have attached here? Smile all your codes are correct..
<signature too big>
Reply
#32
@joshee

global.lang.php
did you mean ?
Code:
$l['code'] = "Code:";
$l['php_code'] = "PHP Code:"
and how to insert <a href="#" onclick="selectCode(this); return false;">[Select all]</a> ?


(11-08-2009, 07:34 PM)Joshee Wrote: Javascript code:
Code:
<script type="text/javascript">
function selectCode(a)
{
   var e = a.parentNode.parentNode.getElementsByTagName('CODE')[0];
   if (window.getSelection)
   {
      var s = window.getSelection();
       if (s.setBaseAndExtent)
      {
         s.setBaseAndExtent(e, 0, e, e.innerText.length - 1);
      }
      else
      {
         var r = document.createRange();
         r.selectNodeContents(e);
         s.removeAllRanges();
         s.addRange(r);
      }
   }
   else if (document.getSelection)
   {
      var s = document.getSelection();
      var r = document.createRange();
      r.selectNodeContents(e);
      s.removeAllRanges();
      s.addRange(r);
   }
   else if (document.selection)
   {
      var r = document.body.createTextRange();
      r.moveToElementText(e);
      r.select();
   }
}
</script>

And I have
Code:
Code: <a href="#" onclick="selectCode(this); return false;">[Select all]</a>
And
Code:
PHP Code: <a href="#" onclick="selectCode(this); return false;">[Select all]</a>
In the languages.
Reply
#33
Nice idea thanks.

i have change
PHP Code:
<a href="#" onclick="selectCode(this); return false;">[Select all]</a

to button style

PHP Code:
<input type="button" value="SELECT ALL" style="width:100px;font-size:10px;margin:0px;padding:0px;" onclick="selectCode(this); return false;" /> 
Reply
#34
I dont get it now Smile

What should i do for this?
Reply
#35
You don't get what?

You just have to follow the instruction in the first page, that's all.
[Image: statsig.php]
Reply
#36
(09-28-2009, 11:11 PM)Joey_Pham423 Wrote:
Code:
<a href="#" onclick="selectCode(this); return false;">(SELECT ALL)</a>

Hello
Is better to use this code?
Code:
<a href=\"#\" onclick=\"selectCode(this); return false;\">(Select All)</a>
Reply
#37
Does it work with quote?
Reply
#38
yeah it does
[Image: statsig.php]
Reply
#39
how do I align the button to the right?

PHP Code:
<input type="button" value="SELECT ALL" style="width:100px;font-size:10px;margin:0px;padding:0px;" onclick="selectCode(this); return false;" /> 
Reply
#40
Quote:<input type="button" value="SELECT ALL" style="text-align:right; width:100px;font-size:10px;margin:0px;padding:0px;" onclick="selectCode(this); return false;" />
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)