2
Guys I need a super help!
I need to validate a SELECT OPTION that is generated dynamically:
<table class="small-grid" style="margin-top:18px;">
<?php $i=1; foreach ($ImportFields as $EachField): ?>
<tr>
<td style="text-align:right;"><?php echo $EachField; ?></td>
<td>
<select name="MatchedFields<?php echo $i; ?>" id="MatchedFields<?php echo $i; ?>">
<option value="0"><?php InterfaceLanguage('Screen', '1183'); ?></option>
<?php foreach ($CustomFields as $EachCustomField): ?>
<option value="CustomField<?php echo $EachCustomField['CustomFieldID']; ?>"><?php echo $EachCustomField['FieldName']; print_r($EachCustomField['CustomFieldID']); ?></option>
<?php endforeach; ?>
</select>
</td>
</tr>
<?php $i++; endforeach; ?>
</table>
The contents of SELECT OPTION are the same in all fields.
What I need: to perform a validation so that the user does not select the same item twice, displaying some message or an alert warning that the item "Email" (EXAMPLE) has already been selected in the previous SELECT OPTION.
Can anyone help me with any suggestions?
And when the warning shows what happens to duplicate options? changes the first, the last or the two?
– Sergio
Sergio, it should continue on the same page, until you fill all fields without any repeat, gave to understand?
– Vitor
@Vitor You managed to solve the problem?
– Raphael Rosa