# Form validation script problem

**URL:** <https://forum.kirupa.com/t/form-validation-script-problem/123946>\
**Category:** Uncategorized\
**Created:** [September 28, 2004, 6:53pm UTC](https://forum.kirupa.com/t/form-validation-script-problem/123946 "2004-09-28T18:53:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rockinwebguy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/rockinwebguy/32/420_2.png) [@Rockinwebguy](https://forum.kirupa.com/u/Rockinwebguy)\
**Post date:** [September 28, 2004, 6:53pm UTC](https://forum.kirupa.com/t/form-validation-script-problem/123946/1 "2004-09-28T18:53:16Z")

</div>

I recently had a client ask me to fix a previously designed Contact form on their Flash site. The form works perfectly, except for the fact that the missing fields test does not seem to work. (In other words, it doesn’t recognize when required fields are left blank.) Below is the script that is called when the Submit button is clicked…it should jump to a frame that contains this:

Logo.gotoAndStop(“YELLOW”);  
lbl\_fm\_name.gotoAndStop(“BLACK”);  
lbl\_fm\_title\_dept.gotoAndStop(“BLACK”);  
lbl\_fm\_comp.gotoAndStop(“BLACK”);  
lbl\_fm\_biz\_type.gotoAndStop(“BLACK”);  
lbl\_fm\_addr.gotoAndStop(“BLACK”);  
lbl\_fm\_city.gotoAndStop(“BLACK”);  
lbl\_fm\_state.gotoAndStop(“BLACK”);  
lbl\_fm\_zip.gotoAndStop(“BLACK”);  
lbl\_fm\_phone.gotoAndStop(“BLACK”);  
lbl\_fm\_email.gotoAndStop(“BLACK”);

Then, 5 frames later, it should procedd to a frame containing this script:

function MarkFields(state) {  
ar\_error\_fields = new Array();  
ar\_error\_fields = FormData.php\_result.split(":");  
for (x=0; x\<ar\_error\_fields.length; x++) {  
eval(“lbl\_”+ar\_error\_fields[x]).gotoAndStop(state);  
}  
}  
if (FormData.php\_check eq “1”) {  
if (FormData.php\_status eq “ef”) {  
MarkFields(“RED”);  
gotoAndStop(“FORM-MISSING”);  
} else if (FormData.php\_status eq “pm”) {  
MarkFields(“RED”);  
gotoAndPlay(“FORM-MISMATCH”);  
} else if (FormData.php\_status eq “1”) {  
gotoAndPlay(“FORM-END”);  
} else if (FormData.php\_status eq “X”) {  
gotoAndPlay(“FORM-PERROR”);  
} else {  
gotoAndPlay(“FORM-TEST”);  
}  
}

Any help would be appreciated!

Thanks  
Rockinwebguy
