Put this at top of page
<?php
if($_SERVER["REQUEST_METHOD"] == "POST") {
foreach($_POST as $key => $val) {
if(is_array($_POST[$key])) $_POST[$key] = implode(", ", $_POST[$key]);
}
}
?>
Put this before the form
<?php $selected = explode(", ", ValidatedField("index_500","player1")); ?>
and this is the form
<form id="form1" name="form1" method="post" action="">
<label for="player1"><strong>Your Name:</strong></label>
<select name="player1[]" id="player1">
<option value="" selected="selected">Select From Dropdown</option>
<?php
do {
?>
<option value="<?php echo $row_rs_members['First Name']?> <?php echo $row_rs_members['Last Name']?>" <?php if(in_array($row_rs_members['First Name'], $selected)) echo("selected=\"selected\""); ?>><?php echo $row_rs_members['First Name']?> <?php echo $row_rs_members['Last Name']?></option>
<?php
} while ($row_rs_members = mysql_fetch_assoc($rs_members));
$rows = mysql_num_rows($rs_members);
if($rows > 0) {
mysql_data_seek($rs_members, 0);
$row_rs_members = mysql_fetch_assoc($rs_members);
}
?>
</select>
<?php
if (ValidatedField('index_500','index_500')) {
if ((strpos((",".ValidatedField("index_500","index_500").","), "," . "1" . ",") !== false || "1" == "")) {
if (!(false)) {
?>
<span class="stylered">Name required</span>
<?php //WAFV_Conditional index.php index_500(1:)
}
}
}?>
<br />
<br />
<label for="tee1"><strong>Your Tee Choice:</strong></label>
<select name="tee1" id="tee1">
<option value="" selected="selected" <?php if (!(strcmp("", (ValidatedField("index_500","tee1"))))) {echo "selected=\"selected\"";} ?>>Select Your Tee</option>
<option value="Gold" <?php if (!(strcmp("Gold", (ValidatedField("index_500","tee1"))))) {echo "selected=\"selected\"";} ?>>Gold</option>
<option value="White" <?php if (!(strcmp("White", (ValidatedField("index_500","tee1"))))) {echo "selected=\"selected\"";} ?>>White</option>
<option value="Blue" <?php if (!(strcmp("Blue", (ValidatedField("index_500","tee1"))))) {echo "selected=\"selected\"";} ?>>Blue</option>
<option value="Black" <?php if (!(strcmp("Black", (ValidatedField("index_500","tee1"))))) {echo "selected=\"selected\"";} ?>>Black</option>
</select>
<?php
if (ValidatedField('index_500','index_500')) {
if ((strpos((",".ValidatedField("index_500","index_500").","), "," . "2" . ",") !== false || "2" == "")) {
if (!(false)) {
?>
<span class="stylered">Tee Required</span>
<?php //WAFV_Conditional index.php index_500(2:)
}
}
}?>
<br />
<br />
<label for="pairing1"><strong>Pairing Request:</strong></label>
<textarea name="pairing1" id="pairing1" cols="45" rows="5"><?php echo(ValidatedField("index_500","pairing1")) ?></textarea>
<br />
<br />
<input type="submit" name="submit2" id="submit2" value="Submit Saturday Signup" />
</p>
</form>
It seems that the if in array statement would have to include both First Name and Last Name, but not sure?
Currently the validation to require a choice for player1 works but does not bind the choice upon validation failed.