RequiredIfTrue

Sep 11, 2012 at 6:21 PM

Hi,

I have a bool property that uses two radio buttons to set its value.  Next I have two string properties, one uses the RequiredIfFalse and the other uses RequiredIfTrue.  The RequiredIfFalse validation works perfectly on server and client.  The RequiredIfTrue only works on the server for some reason. 

Here's my html:

 

<label for="YesNoAnswer">AnswerYesNo?</label>
<input checked="checked" data-val="true" data-val-required="Required" id="YesNoAnswer" name="YesNoAnswer" type="radio" value="True" /> Yes
<input id="YesNoAnswer" name="YesNoAnswer" type="radio" value="False" /> No

<span class="field-validation-valid" data-valmsg-for="IncidentType" data-valmsg-replace="true"></span> <br /><br />
 <b>occurred in:</b> <br />
 <select data-val="true" data-val-requiredif="Required" data-val-requiredif-dependentproperty="YesNoAnswer" data-val-requiredif-dependentvalue="False" data-val-requiredif-operator="EqualTo" id="IncidentLocation" name="IncidentLocation"><option value="">Choose . . . </option>
<option value="AVOCA">Avoca</option>
<option value="somechoice_LNG">some choice LNG</option>
<option value="someotherchoice">some other choice</option>
</select>
<span class="field-validation-valid" data-valmsg-for="IncidentLocation" data-valmsg-replace="true"></span> <br /><br /></div>
    </div>
    <div class="section" id="AspectMessages"> 
    <h3>Choose Aspect Message to Play:</h3>     
    <p><span class="field-validation-valid" data-valmsg-for="ASMessage" data-valmsg-replace="true"></span></p>   
<input data-val="true" data-val-requiredif="Please choose any Aspect message." data-val-requiredif-dependentproperty="YesNoAnswer" data-val-requiredif-dependentvalue="True" data-val-requiredif-operator="EqualTo" id="ASMessage" name="ASMessage" type="radio" value="ASMESSAGE590" />590 - Aspect Message <br />
<input id="ASMessage" name="ASMessage" type="radio" value="ASMESSAGE591" />591 - Aspect Message <br />
<input id="ASMessage" name="ASMessage" type="radio" value="ASMESSAGE592" />592 - Aspect Message <br />
</div>