PDA

View Full Version : tld-dropbox multiselect



RayMatrix
06-22-2005, 07:31 AM
Hi,

is there an easy way to use 'multiselect' for tlds when i use the Dropdownbox?
may it is also possible to have a listfiled to check all ?

Any help is welcome!

Thanks for that genius Script !!

Patrick
06-23-2005, 09:08 PM
Not sure exactly what you want with the drop down.

Simple enough I suppose for the check all.

I am disappointed in myself as usually I remember to slip in the id="" attributes for all my input stuff, but I guess I overlooked that here. Other than that, you can do this with some simple javascript.

Step one:
Open up whois/classes/display.php in a text editor and replace the following:

Replace:

$searchbar .= "<td class=\"whoisSearchTable\"><input type=\"checkbox\" name=\"ext{$i}\" value=\"{$ext}\"" .

With:

$searchbar .= "<td class=\"whoisSearchTable\"><input type=\"checkbox\" name=\"ext{$i}\" id=\"ext{$i}\" value=\"{$ext}\"" .

Step Two:
Add this javascript between the <head> </head> tags of your site:

<script language="Javascript" type="text/javascript">
function tldCheckAll()
{
for(i=0, finished=false; !finished; i++)
{
extBox = document.getElementById("ext" + i);
if (extBox != null)
extBox.checked = true;
else
finished = true;
}
}
</script>

Step Three:
Place a "check all" link anywhere you want via the templates page of the script:

<a href="javascript:tldCheckAll();">Check All</a>

That should do it.