Chosen Plug validation

Chosen Plug validation

I have a page with two Selects using Chosen plugin.  They work great, but I need to do something special and can't seem to come up with the right way to validate this option.

I want to have users only be able to select an option from one dropdown or the other, but not both.  My first thought was to disable one select if something was selected on the other.  Then if they selected the first item(0 index) it would re-enable the other one.  and then same with the other select.  They are required to select at least one item from one dropdown or the other.

I'm pretty new to jquery, but have been using the Chosen plugin on several different select tags with no problem.  Now, someone wants this new option and I'm clueless how to get it to do what is needed.

Here is the code I've got for the page without any validation, since nothing I've tried has worked.  Thanks for any assistance you can give me.

  1. <div>
      <p>PARTY</p><br />
      <span>Filed on Behalf of what Entity(ies): </span><br />
      <%
      set RS=Server.CreateObject("ADODB.recordset")
      sql="to collect list of entity names"
      RS.Open sql, cnnstrassd
      %>
      <select data-placeholder="Choose Entity(ies)..." class="chzn-select" id="Party" name="Entity" multiple="multiple" style="width:400px; height:60px;" >
        <%
        Do While Not RS.EOF
        %>
            <option value="<%= RS.Fields("vch255Name")%>"><%= RS.Fields("vch255Name")%></option>
        <%
        RS.MoveNext
        Loop
        Set RS = Nothing
        %>
      </select>
    </div>
    <div>
      <p>PENDING PARTY/NON-PARTY</p><br />
      <span>Filed on Behalf of what Entity(ies): </span><br />
      <%
      set RS=Server.CreateObject("ADODB.recordset")
      sql="to collect list of company names"
      RS.Open sql, cnn
      %>
      <select data-placeholder="Choose Entity(ies)..." class="chzn-select" id="NonParty" name="Entity" multiple="multiple" style="width:400px; height:60px;">
        <%
        Do While Not RS.EOF
        %>
            <option value="<%= RS.Fields("CompanyName")%>"><%= RS.Fields("CompanyName")%></option>
        <%
        RS.MoveNext
        Loop
        Set RS = Nothing
        %>
      </select>
    </div>
  2. <script type="text/javascript">
    var config = {
    '.chzn-select': {},
    '.chzn-select-deselect': { allow_single_deselect: true },
    '.chzn-select-no-single': { disable_search_threshold: 10 },
    '.chzn-select-no-results': { no_results_text: 'Oops, nothing found!' },
    '.chzn-select-width': { width: "90%" }
    }
    for (var selector in config) {
    $(selector).chosen(config[selector]);
    }
  3. </script>


Jack