$("#detail_submit").on("click", function(){
    var title = $("#detail_form").find("input[name='title']");
    var specialid = $("#detail_form").find("select[name='specialid']");
    if($(title).val()==""){
      layer.tips('请填写名称', $(title), {tips: [1, '#FF5722']});
      return false;
    }
    if($(specialid).val()==""){
      layer.msg("请选择专业", {icon: 2});
      return false;
    }
    $("#detail_form").ajaxSubmit({
        url: '/glqcourse/course/basicok', 
        type: 'POST',
        dataType: "json", 
        beforeSend: function(){
          layer.load(0, {shade: [0.2, '#393D49']});
        },
        success: function(data){
          if(data.code=="success"){
              layer.msg('成功', {icon: 1}, function(){parent.window.location.reload();});
          }else{
              layer.msg(data.msg, {icon: 2});
          }
        },
        error: function(){
          layer.msg("系统错误，请联系管理员", {icon: 2});
        },
        complete: function(){
          layer.closeAll('loading');
        }
    });
    return false;
});