RE: Can someone help me with some form validation?
1) a) sort the array using the sort() function
b) check if one item is different than the one before it
2) Since you need to check on each item anyways in point 1, you can also immeditaly check the existance of spaces using the function indexOf().
Or you can do it after/before point 1 in one single line by joining all the elements of the array into a string and then using the function indexOf() on that joined string (but that requires more memory).
-----------------------------
[former placeholder of a lot of crap talk about how to loop through an array... thx to Markee for slapping me around a bit with some sense]
This post was edited on 07-23-2007 at 06:45 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
|