dubito fortemente che

document.getElementsByName()

possa funzionare, se non altro perchè restituirebbe un array... quelle che nel codice hai chiamato 'condizioni' e 'privacy' che attributi sono di preciso? Name? Id?...