I have a page to contact me and I need all fields filled out. I have to use alert
to warn that you have not entered any field and what is that field. I tried to use isNaN
but it did not work for me.
Also try this but it did not work quite well:
function validar(name, email, msg)
{
if (name="")
{
alert(No has introducido tu nombre)
}
else if (email="")
{
alert("No has introducido tu email")
}
else if (msg="")
{
alert("no has introducido ningún mensaje")
}
else
{
alert("El mensaje ha sido enviado correctamente")
}
}