Javascript form validation works in IE but not in Firefox [closed]

2

Good afternoon everyone. I'm trying to validate a form by checking if the value field is filled in and is greater than 0.

It worked perfectly in IE, but in Firefox it does not work for anything in the world!

Follow the code:

    <script language="JavaScript">
        function valida(){
        f = document.form2;
        var valor = f.vlrass.value;

        if (valor==""){
           alert("Informar valor original da contribuição.")
           f.vlrass.focus()
           return false;
        }
           if (valor==0){
              alert("Informar valor original da contribuição.")
              f.vlrass.focus()
              return false;
           }
    }
    </script>

And the form call:

    <input type="submit" name="Submit" value="Listar Vencimentos"" onclick="return valida()">

Any ideas?

    
asked by anonymous 16.09.2014 / 19:46

1 answer

0

I do not think I saw the quotation marks that were left !!!! It was all the fault of it here:

<input type="submit" name="Submit" value="Listar Vencimentos"" onclick="return valida()">
                                              Aspa sobrando! ^
    
16.09.2014 / 19:51