What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Can someone help me with some form validation?

Can someone help me with some form validation?
Author: Message:
MeEtc
Patchou's look-alike
*****

Avatar
In the Shadow Gallery once again

Posts: 2200
Reputation: 60
38 / Male / Flag
Joined: Nov 2004
Status: Away
O.P. Can someone help me with some form validation?
I have an array of strings string variables in a constructor in a script that I am making. Can someone make me or provide the info for me to make a function that 1. confirms that no string is equal, and 2. no string contains spaces?

This post was edited on 07-22-2007 at 09:25 PM by MeEtc.
[Image: signature/]     [Image: sharing.png]
I cannot hear you. There is a banana in my ear.
07-22-2007 07:56 PM
Profile PM Web Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
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 =-.
07-22-2007 09:12 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On