# Form validation script problem

**URL:** <https://forum.kirupa.com/t/form-validation-script-problem/65685>\
**Category:** flash\
**Created:** [September 28, 2004, 6:53pm UTC](https://forum.kirupa.com/t/form-validation-script-problem/65685 "2004-09-28T18:53:16Z")\
**Posts on this page:** 4\
**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/65685/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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 28, 2004, 7:16pm UTC](https://forum.kirupa.com/t/form-validation-script-problem/65685/2 "2004-09-28T19:16:48Z")

</div>

This doesn’t appear to have anything to do with validating any forms. It just checks to see if they are valid. To me, it looks like a PHP script actually does the validating. Do you have that?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 28, 2004, 7:57pm UTC](https://forum.kirupa.com/t/form-validation-script-problem/65685/3 "2004-09-28T19:57:49Z")

</div>

GL,

Thanks for your help. I found the PHP file, but it won’t let me post the code here as it has too many characters. Any ides?

Rockin

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 28, 2004, 8:13pm UTC](https://forum.kirupa.com/t/form-validation-script-problem/65685/4 "2004-09-28T20:13:11Z")

</div>

attach it.

Warning:  
I’m not that good with PHP, fortunatly there are many here who are.
