Small, short code snippets that other people may find useful. Do you have a good regex that you would like to share? Share it! Even better, the code can be commented on, and improved.
If you would prefer to have Check all :: Uncheck all links, instead of a toggle, you may use this code (Stolen from phpBB Olympus, but it is hardly complicated enough to warrant a disclaimer, imo...):
function marklist(form_name, status)
{
for (i = 0; i < document.formsїform_name].length; i++)
{
document.formsїform_name].elementsїi].checked = status;
}
}
it helps to know the name of the element you wish to toggle, iterating blindly through the form's element array can lead to you adding the checked property to several objects which don't need it (type checking helps)