[F8]
Ok, I’ve got this assignment that I’m stuck with.
I was supposed to:
[INDENT]set the validate range for the Name field to be checked with an array of 3 names, the validate range for the Password field to be checked with an array of 3 passwords, and the validate range for the State field to be checked with an array of 3 states in order to create my own error messages.[/INDENT]
Can someone tell me what I did wrong?
[COLOR=Navy]**stop();
var errors:Array=new Array();
function clearForm() {
name_ti.text="";
state_ti.text="";
password_ti.text="";
errorLog_lb.removeAll();
errors.length = 0;
errorLog_lb.alternatingRowColors = null;
}
function validateState() {
var states:Array = [“California”, “New York”, “Louisiana”];
var matchFound:Boolean = false;
for (var i = 0; i <= states.length; ++i) {
if (state_ti.text== states*) {
matchFound = true;
break;
}
}
if (!matchFound) {
errors.push(“Please enter a valid state”);
state_ti.setStyle(“color”, 0x990000);
}
}
function validateName() {
var names:Array = [“Julia”, “Robin”, “Patricia”];
var matchFound:Boolean = false;
for (var i = 0; i <= names.length; ++i) {
if (name_ti.text== names*);
matchFound = true;
break;
}
}
if (!matchFound) {
errors.push(“Please enter a valid name.”);
name_ti.setStyle(“color”, 0x990000);
}
function validatePassword() {
var passwords:Array = [“1234”, “4567”, “7890”];
var matchFound:Boolean = false;
for (var i = 0; i <= passwords.length; ++i) {
if (password_ti.text== passwords*) {
matchFound = true;
break;
}
}
if (!matchFound) {
errors.push(“Please enter a valid password”);
password_ti.setStyle(“color”, 0x990000);
}
}
clearButton_mc.onRelease = function(){
clear();
}
**[/COLOR]
P.S.: Let me know if you’re willing to help me and I’ll send you the file directly via email.
I can’t upload it 'cause it’s too large.