Make field not required based to dropdown list selection MVC 5
<p>In my MVC 5 app, I have a form with a dropdown and some fields which are required. I need to change this attribute of the fields when the dropdown selection is change.</p>

<p>I have this enum</p>

<pre><code>public enum OrderKind
{

    Market,
    Research,

}
</code></pre>

<p>from which I fill the dropdown list. I have use javascript so to show or hide fields which work. </p>

<p>Something as</p>

<pre><code> $(function () {

  $('#orderkind').change(function () {
            var value = $(this).val();
            if (value == "Market") {
                $(datefrom).hide();
                $(datefrom).hide();
                $("#fromDate").attr("required", false);
                $("#toDate").attr("required", false);
    else if (value == "Research") {
                $(datefrom).show();
                $(datefrom).show();
                $("#fromDate").attr("required", true);
                $("#toDate").attr("required", true);
                fromDate.setCustomValidity('Please Fill the date from field');
                toDate.setCustomValidity('Please Fill the date to field');
          }
</code></pre>

<p>but it makes the date fields always required, even when they are filled it displays the message. 
Is there a way to check the dropdown list value from Controller?
thank you!</p>