Jump to content

validation problems


carl allan

Recommended Posts

You can use the RegExp method "match" to check:

  <script type="text/javascript">  var testA = 'Someone@onewww.com';  if(testA.match(/@/g) == null || testA.match(/@/g).length != 1 ){    alert('bad string');    }  else {    alert('good string');    } </script>

Thanks,

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...