Jump to content

bulk checker but with TLD checkboxes


ozace

Recommended Posts

Has anyone done a bulk checker that has, like the single checker, a series of check-boxes for TLD's and you don't have to put each fully qualified name in main box.

 

ie can enter fred, freddy, thommy etc in main box and then tick the required TLD's below rather than having to fqdn the domains in the main box?

 

i assume that I would have to write a small program that takes this input and then creates each fqdn and then pass to integration code for bulk checking ? Or is there something already out there and available :-)

 

cheers

 

Jim

Link to comment
Share on other sites

Hi ozace,

I wrote the code you're looking for (I hope I understood your question):

Copy/Past in to the file that will contain the form in the WHMCS folder, you will need to add extensions manually.

Note: it will be submitted to Bulk Domain Search page of WHMCS.

 

<script type="text/javascript">
function formatSearch(){
var tlds=Array();	
/* Load words to search (SLD) into Array */
var slds=document.getElementById('mutilsld').value.split("\n");	
j=0;
/* Load checked TLDs into Array */
for (i = 0; i < document.formBulk.tld.length; i++)
     if (document.formBulk.tld[i].checked){
        tlds[j] =document.formBulk.tld[i].value;
	 j++;
     }	
var txt="";	  
for(i=0;i<slds.length;i++){
for(j=0;j<tlds.length;j++){
		txt= txt + slds[i] + tlds[j] + "\n";
}
}

document.getElementById('bulkdomains').value=txt;
}
</script>
<form id="formBulk" name="formBulk" method="post" action="domainchecker.php?search=bulk" onsubmit="formatSearch()">
 <p>
   <textarea name="mutilsld" id="mutilsld" cols="45" rows="5"></textarea>
 </p>
 <p>
   <input name="tld" type="checkbox" id="tld" value=".com" />
   .com
   <input name="tld" type="checkbox" id="tld" value=".net" />
   .net
   <input name="tld" type="checkbox" id="tld" value=".org" />
   .org
 </p>
 <p>
 <input type="hidden" name="bulkdomains" id="bulkdomains" />
<input type="submit" id="Submit" value="Lookup" />
 </p>
</form>

Link to comment
Share on other sites

A nice script with a couple of modifcations needed.

Firstly add {literal} before the script (and obviously after)

 

If you'd like to add a check all script, you can add below

 

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.checked = CheckValue;

}

</script>

{/literal}

 

and just below the list of tlds

 

<p align="center"><a href="javascript:SetAllCheckBoxes('formBulk', 'tld', true);">Check all</a> | <a href="javascript:SetAllCheckBoxes('formBulk', 'tld', false);">Uncheck all</a></p>

 

Otherise, thanks for the contribution.

Link to comment
Share on other sites

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated