Ho cambiato "If" in "if" e trasformato "getElementsByName". Non cambia nulla.