Skip to main content
improved title
Link
BalusC
  • 1.1m
  • 377
  • 3.7k
  • 3.6k

Help Me in input validation How to validate an email address using JavaScript?

added 108 characters in body
Source Link
marcgg
  • 66.9k
  • 53
  • 183
  • 238

i am trying to doing input validation its my complete code but it is not working well.

Testing Validation function getvalue() { value = document.getElementById('myId').value; if(value 'z' || value != '@' && value != '.') { alert("Not a valid E-mail adress"); }
<html> <head> <title>Testing Validation</title> <script type = "text/javascript"> function getvalue() { value = document.getElementById('myId').value; if(value < 'a' || value > 'z' || value != '@' && value != '.') { alert("Not a valid E-mail adress"); } } </script> </head> <body> <form name = "frm"> <input type="text" name="input" size="40" id="myId" /> <input type = "submit" name = "submit" onclick="getvalue()" /> </form> </body> </html> 
}

i am trying to doing input validation its my complete code but it is not working well.

Testing Validation function getvalue() { value = document.getElementById('myId').value; if(value 'z' || value != '@' && value != '.') { alert("Not a valid E-mail adress"); } }

i am trying to doing input validation its my complete code but it is not working well.

<html> <head> <title>Testing Validation</title> <script type = "text/javascript"> function getvalue() { value = document.getElementById('myId').value; if(value < 'a' || value > 'z' || value != '@' && value != '.') { alert("Not a valid E-mail adress"); } } </script> </head> <body> <form name = "frm"> <input type="text" name="input" size="40" id="myId" /> <input type = "submit" name = "submit" onclick="getvalue()" /> </form> </body> </html> 
Source Link
Imran Ali
  • 59
  • 2
  • 10

Help Me in input validation

i am trying to doing input validation its my complete code but it is not working well.

Testing Validation function getvalue() { value = document.getElementById('myId').value; if(value 'z' || value != '@' && value != '.') { alert("Not a valid E-mail adress"); } }