<div id="sy_popup_box">
  <div class="sy_popup_top">
    <h3 class="fl">欢迎加入班级</h3>
    <a href="javascript:void(0);" class="sy_icons_close fr" onclick="hideModal()"></a>
    <div class="cl"></div>
  </div>
  <div class="sy_popup_con">
    <%= form_tag({:controller => 'courses', :action => 'join_course_multi_role'}, :remote => true, :method => :post, :id => 'new-watcher-form') do %>
        <ul class="sy_popup_add ">
          <li>
            <label>班级邀请码：</label>
            <input class=" sy_input_txt fl" name="invite_code" placeholder="请输入五位班级邀请码">

            <div class="cl"></div>
          </li>
          <li>
            <label>身份：</label>
            <input type="checkbox" name="role[]" value="9" id="join_course_role_9" class="ml5 mr5 "/><span class="mr10">教师</span>
            <input type="checkbox" name="role[]" value="7" id="join_course_role_7" class="ml5 mr5"/><span class="mr10">助教</span>
            <input type="checkbox" name="role[]" value="10" id="join_course_role_10" class="ml5 mr5"/><span class="mr10">学生</span>

            <div class="cl"></div>
          </li>
          <li>
            <label>&nbsp;</label>
            <a href="javascript:void(0);" class="sy_btn_blue fl" onclick="$('#new-watcher-form').submit();hideModal()">确&nbsp;&nbsp;定</a>
            <a href="javascript:void(0);" class="sy_btn_grey fl ml20" onclick="hideModal()">取&nbsp;&nbsp;消</a>

            <div class="cl"></div>
          </li>
        </ul>
    <% end %>
  </div>
</div>
<script>
    $(function() {
        $("#join_course_role_7").on('click', function(){
            if($("#join_course_role_7").is(":checked")) {
                $("#join_course_role_9").attr('disabled', 'disabled');
            } else {
                $("#join_course_role_9").removeAttr('disabled');
            }
        });
        $("#join_course_role_9").on('click', function(){
            if($("#join_course_role_9").is(":checked")) {
                $("#join_course_role_7").attr('disabled', 'disabled');
            } else {
                $("#join_course_role_7").removeAttr('disabled');
            }
        });
    });
</script>