function DisableElementsByName(elements, name) { for (var i = 0; i < elements.length; i++) { if(elements[i].name == name) elements[i].disabled = true; } }