I'm having trouble calling two functions to validate the txtnome
and txtsobrenome
fields, calling the functions validanome()
and validasobrenome()
.
I tried calling them as follows:
if (!validanome(cad.txtnome.value)) {
return;
}
if (!validasobrenome(cad.txtsobrenome.value)) {
return;
}
The entire code of my page and script is here .
There are two functions in JavaScript.
I'd like someone to briefly review and find out why I'm going wrong, what I'm failing. The functions validanome
and validasobrenome
I listed are there at the end of the script, and I'm trying to call it in my validaFormulario()
function.
Note: I took else
at the end of function validanome()
and validasobrenome()
, but it did not work yet.