Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 92756

Re: JavaScript E-mail Validation Script Issues

$
0
0

If this is a validate script, there are several problems with it. First of all, event.value will always be a string, so it will never be equal to the the special value null. To test for a zero-length string, compare it to one:

 

if (event.value !== "") {

 

or better yet:

 

if (event.value) {

 

 

This means you don't have to use the toString method to convert it to a string, since it always will be one.

 

The split string method is not capitalized, so valueInfo.Split is not correct.

 

Assuming you didn't somehow incorporate JQuery or something similar, the following line isn't valid:

 

$.each(emailArray, function(i,val){ 

 

 

Use a simple for loop instead.


Viewing all articles
Browse latest Browse all 92756

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>