Link to home
Start Free TrialLog in
Avatar of OBCT
OBCT

asked on

Creating an XML string

In a recent project I have been working on, I have an input box that I have prevented users from entering in unapropriate words by using an array and a "for" loop.
This is what my code looks like.

badWords = ["milk", "juice", "cordial", "wine", "beer"];
mybutton.onRelease = function ()
{
     if (this._parent.txtBox.length > 0) {
          for (i in badWords) {
               if (txtBox.indexOf(badWords[i])>-1) {
          status = "No Swearing";
               return;
               }
          }
     }
}

How can I achieve this same idea, however using values from an external xml file?

Cheers

-OBCT
Avatar of OBCT
OBCT

ASKER

Sorry the title was meant to be "Creating an XML array"
ASKER CERTIFIED SOLUTION
Avatar of blue-genie
blue-genie
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of OBCT

ASKER

Thank you, blue. You are a genius :D
Cheers for that

-OBCT