I have a form with select Field A. This field can be dynamically populated based on the URL or it can be selected as usual.
Once a value has been selected in Field A either way, select Field B is populated and exposed with JQuery AJAX.
Here is the problem. If Field A is left untouched, and is dynamically populated by the URL, Field B will properly validate. However, if Field A is changed, Field B will no longer attempt to validate.
Field A
<select name="FieldA" id="FieldA">
<option value="">Please Select</option>
<?php
while($FieldA= mysql_fetch_array($result2)) {
?>
<option value="<?php echo $FieldA['FieldAID']; ?>"<?php if ($var == $FieldA['FieldAID']) echo " selected=\"selected\""; ?>><?php echo $FieldA['FieldAName']; ?> </option>
<?php } ?>
</select>
Field B
<select name="FieldB" id="FieldB">
<option value="">Please Select</option>
<?php
while($FieldB = mysql_fetch_array($result)) {
?>
<option value="<?php echo $FieldB['FieldBID']; ?>"><?php echo str_replace('|',' - ',$FieldB['FieldBName']); ?></option>
<?php } ?>
</select>
Validation Criteria
<script language="JavaScript" type="text/javascript">
var frmvalidator = new Validator("FormName");
frmvalidator.addValidation("FieldA","req","Please select FieldA.");
frmvalidator.addValidation("FieldB","req","Please select FieldB.");
</script>
Everything works EXCEPT that the AJAX call breaks the validation for Field B. If Field B is not repopulated, it works fine. Field B is constructed with an include file so it is the same whether populated by the page or the AJAX call.
Thank you!