javascript function is giving error [closed]

1

This function is not being called and is giving error. It does not say exactly the error, but it gives error soon to enter the form:

function ChangeSituacao(){
        var vRads = document.getElementsByName('ind_situacao');
        for(var i = 0; i < vRads.Length; i++){
            alert(vRads[i].checked);
    }

The idea goes through a collection of Radiobutton and pick up what is checked and then apply the rule of business. What is wrong with this function?

    
asked by anonymous 05.01.2017 / 12:22

1 answer

4

Your for is not being closed

function ChangeSituacao(){
        var vRads = document.getElementsByName('ind_situacao');
        for(var i = 0; i < vRads.Length; i++){
            alert(vRads[i].checked);
        } //Você esqueceu de fechar o for aqui
}
    
05.01.2017 / 12:25