Page 1 of 2 12 LastLast
Results 1 to 15 of 21

Thread: How to add check/uncheck all TLD's on the simple domain checker

  1. #1
    Join Date
    Aug 2007
    Posts
    248

    Default How to add check/uncheck all TLD's on the simple domain checker

    I have put some code together to allow checking and unchecking all TLD's within the simple domain availability checker.

    You can see a demo here: http://www.magdesign.co.uk/clients/domainchecker.php

    To add this, follow the instructions below:

    First, open your domainchecker.tpl file

    Add the following code to the top of the page:

    Code:
    {literal}
    <script LANGUAGE="JavaScript">
    function SetAllCheckBoxes(FormName, FieldName, CheckValue)
    {
    	if(!document.forms[FormName])
    		return;
    	var objCheckBoxes = document.forms[FormName].elements[FieldName];
    	if(!objCheckBoxes)
    		return;
    	var countCheckBoxes = objCheckBoxes.length;
    	if(!countCheckBoxes)
    		objCheckBoxes.checked = CheckValue;
    	else
    		// set the check value for all check boxes
    		for(var i = 0; i < countCheckBoxes; i++)
    			objCheckBoxes[i].checked = CheckValue;
    }
    </script>
    {/literal}
    Find the code:

    Code:
    <form method="post" action="domainchecker.php" >
    And change it to:

    Code:
    <form method="post" action="domainchecker.php" name="domainchecker">
    Now you just need to add the below code wherever you want the "Check all | Uncheck all" links to appear:

    Code:
    <a href="javascript:SetAllCheckBoxes('domainchecker', 'tlds[]', true);">Check all</a> | <a href="javascript:SetAllCheckBoxes('domainchecker', 'tlds[]', false);">Uncheck all</a>
    Hopefully some of you may find this useful!

  2. #2
    Join Date
    Nov 2007
    Posts
    99

    Default

    thank you!

  3. #3

    Default

    Very nice addition. Thanks
    Affordable Shared Hosting services at WebHosting.am

  4. #4
    Join Date
    Jun 2007
    Posts
    885

    Default

    Good Idea thanks!

  5. #5
    Join Date
    Nov 2007
    Location
    Melbourne Australia
    Posts
    672

    Default

    very nice little function. thank you for your effort.
    That StartUp Guy
    Changing the world, one 'Great Idea' at a time.

  6. #6
    Join Date
    Feb 2008
    Posts
    15

    Default

    nice Tip thx.
    How to get DirectDebit running on WHMCS here | German WHMCS User Group Support Forum | WHMCS Reseller

  7. #7
    Join Date
    Feb 2009
    Posts
    40

    Default

    Very handy little mod. Thanks

  8. #8
    Join Date
    Mar 2008
    Posts
    33

    Default

    Simple + Useful = Great work. Thanks!

  9. #9
    Join Date
    Feb 2009
    Location
    Bucharest - Romania
    Posts
    1

    Default

    Very useful, very simple, very good! Thank you!

  10. #10
    Join Date
    Feb 2009
    Posts
    64

    Default

    Thank you, I too find this useful

  11. Smile thanks

    its very useful for everyone

  12. #12
    Join Date
    May 2010
    Posts
    11

    Thumbs up Thanks! Great Tip

    Very usefull!!!

    thanks m8!

  13. #13
    Join Date
    May 2007
    Posts
    19

    Default

    Nice, thanks for sharing.

  14. #14
    Join Date
    Aug 2010
    Posts
    2

    Default

    Quote Originally Posted by magga View Post
    I have put some code together to allow checking and unchecking all TLD's within the simple domain availability checker.

    You can see a demo here: http://www.magdesign.co.uk/clients/domainchecker.php

    To add this, follow the instructions below:

    First, open your domainchecker.tpl file

    Add the following code to the top of the page:

    Code:
    {literal}
    <script LANGUAGE="JavaScript">
    function SetAllCheckBoxes(FormName, FieldName, CheckValue)
    {
    	if(!document.forms[FormName])
    		return;
    	var objCheckBoxes = document.forms[FormName].elements[FieldName];
    	if(!objCheckBoxes)
    		return;
    	var countCheckBoxes = objCheckBoxes.length;
    	if(!countCheckBoxes)
    		objCheckBoxes.checked = CheckValue;
    	else
    		// set the check value for all check boxes
    		for(var i = 0; i < countCheckBoxes; i++)
    			objCheckBoxes[i].checked = CheckValue;
    }
    </script>
    {/literal}
    Find the code:

    Code:
    <form method="post" action="domainchecker.php" >
    And change it to:

    Code:
    <form method="post" action="domainchecker.php" name="domainchecker">
    Now you just need to add the below code wherever you want the "Check all | Uncheck all" links to appear:

    Code:
    <a href="javascript:SetAllCheckBoxes('domainchecker', 'tlds[]', true);">Check all</a> | <a href="javascript:SetAllCheckBoxes('domainchecker', 'tlds[]', false);">Uncheck all</a>
    Hopefully some of you may find this useful!
    Where can i add this Code? :
    <a href="javascript:SetAllCheckBoxes('domainchecker', 'tlds[]', true);">Check all</a> | <a href="javascript:SetAllCheckBoxes('domainchecker', 'tlds[]', false);">Uncheck all</a>

    The file domainchecker.php is encoded and i when i add this doce it indicates that the file is corrupted.

    Please help

  15. #15
    Join Date
    Feb 2009
    Location
    Atlanta, GA
    Posts
    1,680

    Default

    You could do this with jquery as well:

    Code:
    <script language="javascript">
    $('#checkAll').click(
       function()
       {
          $("INPUT[type='checkbox']").attr('checked', $('#checkAll').is(':checked'));   
       }
    )
    
    </script>
    Then in the body, Add a checkbox to do the checking for you:
    Code:
    <input type="checkbox" name="checkAll" id="checkAll"/> Check All

Page 1 of 2 12 LastLast

Similar Threads

  1. TLD in domain checker empty???
    By [email protected] in forum Technical Issues and Questions
    Replies: 1
    Last Post: 01-06-12, 05:13 PM
  2. TLD In domain checker
    By andybh in forum Customisation and Integration Questions
    Replies: 0
    Last Post: 11-19-10, 10:54 AM
  3. Cant uncheck Bulk Check TLDs
    By sammybotz in forum Technical Issues and Questions
    Replies: 0
    Last Post: 10-17-07, 04:26 AM
iron-diatonic