select list array binding doesn't work failed validation
Have a select list as an array interest1[] with the multiple selection allowed. The validation works but the binding of the validated entries doesn't.
Code of the validation
<?php
if (isset($_POST["submit1"]) || isset($_POST["submit1_x"])) {
$WAFV_Redirect = "volunteer.php";
$_SESSION['WAVT_volunteer_254_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateRQ(((isset($_POST["name1"]))?$_POST["name1"]:"") . "",false,1);
$WAFV_Errors .= WAValidateEM(((isset($_POST["email1"]))?$_POST["email1"]:"") . "",true,2);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["interest1"]))?implode(",",$_POST["interest1"]):"") . "",false,3);
$WAFV_Errors .= WAValidateLE(strtolower(((isset($_POST["Security_Code_1"]))?$_POST["Security_Code_1"]:"")) . "",strtolower($_SESSION['captcha_Security_Code_1']) . "",true,4);
if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"volunteer_254");
}
}
?>
The binding code of the select list
<select name="interest1[]" size="5" multiple="MULTIPLE">
<option value="" <?php if (!(strcmp("", (ValidatedField("volunteer_254","interest1[]"))))) {echo "selected=\"selected\"";} ?>>Choose Interest</option>
<option value="Fundraising" <?php if (!(strcmp("Fundraising", (ValidatedField("volunteer_254","interest1[]"))))) {echo "selected=\"selected\"";} ?>>Fundraising</option>
<option value="Publicity" <?php if (!(strcmp("Publicity", (ValidatedField("volunteer_254","interest1[]"))))) {echo "selected=\"selected\"";} ?>>Publicity</option>
<option value="Office Assistance" <?php if (!(strcmp("Office Assistance", (ValidatedField("volunteer_254","interest1[]"))))) {echo "selected=\"selected\"";} ?>>Office Assistance</option>
<option value="Food Preparation" <?php if (!(strcmp("Food Preparation", (ValidatedField("volunteer_254","interest1[]"))))) {echo "selected=\"selected\"";} ?>>Food Preparation</option>
<option value="Event Set up/Clean up" <?php if (!(strcmp("Event Set up/Clean up", (ValidatedField("volunteer_254","interest1[]"))))) {echo "selected=\"selected\"";} ?>>Event Set up/Clean up</option>
<option value="Special Occasions" <?php if (!(strcmp("Special Occasions", (ValidatedField("volunteer_254","interest1[]"))))) {echo "selected=\"selected\"";} ?>>Special Occasions</option>
<option value="Fair, Parade Participant" <?php if (!(strcmp("Fair, Parade Participant", (ValidatedField("volunteer_254","interest1[]"))))) {echo "selected=\"selected\"";} ?>>Fair, Parade Participant</option>
<option value="Recruitment" <?php if (!(strcmp("Recruitment", (ValidatedField("volunteer_254","interest1[]"))))) {echo "selected=\"selected\"";} ?>>Recruitment</option>
<option value="Public Speaking" <?php if (!(strcmp("Public Speaking", (ValidatedField("volunteer_254","interest1[]"))))) {echo "selected=\"selected\"";} ?>>Public Speaking</option>
<option value="Bingo Monitoring" <?php if (!(strcmp("Bingo Monitoring", (ValidatedField("volunteer_254","interest1[]"))))) {echo "selected=\"selected\"";} ?>>Bingo Monitoring</option>
<option value="Willing to Help as needed" <?php if (!(strcmp("Willing to Help as needed", (ValidatedField("volunteer_254","interest1[]"))))) {echo "selected=\"selected\"";} ?>>Willing to Help as needed</option>
<option value="Other" <?php if (!(strcmp("Other", (ValidatedField("volunteer_254","interest1[]"))))) {echo "selected=\"selected\"";} ?>>Other</option>
</select>