zoukankan      html  css  js  c++  java
  • Jquery tabs

    官网
    http://api.jqueryui.com/tabs/


    必须通过了后台验证tab1的信息后才允许进入tab2

            var passed=false;
             $("#tabs").tabs({
                event: "click",
                active: 0,
                beforeActivate: function (event, ui) {
                    if (ui.newTab.text() == "Tab2") {
                      $('#tabs-1 .validationMsg').hide();
                        var ok = true;
                        if (!passed ) {
                            ok = validate();  //前台validation
                        }

                        var toDo = function () {
                            passed = true;
                            $('#tabs').tabs("option", "active", 1);
                            //$('#tabs ul li:eq(1) a').focus();
                        }

                        var notToDo = function () {
                            passed = false;
                            var errorMsg = $('#tabs-1 .validationMsg').html();
                            // event.preventDefault();
                            // ui.oldTab.focus();
                            $('#tabs').tabs("option", "active", 0);
                            $('#tabs ul li:eq(0) a').focus();
                            setTimeout("$('#tabs-1 .validationMsg').html('" + errorMsg + "');$('#tabs-1 .validationMsg').show();", 0);
                            return;
                        }

                        if (!ok) {
                            event.preventDefault();
                            notToDo();
                        }
                        else {
                            if (!passed) {
                                validate2($('#tabs-1'), '/controller/action', toDo, notToDo);  //后台ajax验证
                                event.preventDefault();
                            }
                        }

                    }
                }
            });


     

  • 相关阅读:
    WSP部署错误—SharePoint管理框架中的对象“SPSolutionLanguagePack Name=0”依赖其他不存在的对象
    Elevate Permissions To Modify User Profile
    Error with Stsadm CommandObject reference not set to an instance of an object
    ASP.NET MVC3添加Controller时没有Scaffolding options
    测试使用Windows Live Writer写日志
    配置TFS 2010出现错误—SQL Server 登录的安全标识符(SID)与某个指定的域或工作组帐户冲突
    使用ADO.NET DbContext Generator出现错误—Unable to locate file
    CSS
    HTML DIV标签
    数据库
  • 原文地址:https://www.cnblogs.com/sui84/p/6777183.html
Copyright © 2011-2022 走看看