0

我正在尝试使用 Jquery 验证引擎,但我无法管理它工作。我相信验证引擎没有附加表单,可能是因为 Div 标签。这是我的代码,希望你能帮助我。

    <link href="/css/style.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" type="text/css" href="/css/coin-slider.css"/>
    <script type="text/javascript" src="/js/cufon-yui.js"></script>
    <script type="text/javascript" src="/js/cufon-titillium-250.js"></script>
    <script type="text/javascript" src="/js/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="/js/script.js"></script>
    <script type="text/javascript" src="/js/coin-slider.min.js"></script>
    <script src="/js/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8"></script>
    <script src="/js/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>
    <link rel="stylesheet" href="/css/validationEngine.jquery.css" type="text/css"/>
    <link rel="stylesheet" href="/css/template.css" type="text/css">
    <script>
        $(document).ready(function(){
            $("#invite").validationEngine();
        });
    </script>
</head>
<body>
<div class="main" id="main">
    <div class="header">
        <div class="header_resize">

            <div class="clr"></div>

            <div class="clr"></div>
        </div>
    </div>
    <div class="content">
        <div class="content_resize">
            <div class="mainbar">
                <div class="article">
                    <h2><span>Escriba</span> la información sobre el evento</h2>

                    <form action="/jsp/filtered/client/InviteServlet" method="post" name="invite" id="invite">
                        <table>
                            <tr>
                                <td>Nombre del invitado:</td>
                                <td><input type="text" name="name" id="name" class="validate[required] text-input"></td>
                            </tr>
                            <tr>
                                <td>Apellido del invitado:</td>
                                <td><input type="text" name="lastname" id="lastname" class="validate[required] text-input"></td>
                            </tr>
                            <tr>
                                <td>Email del invitado:</td>
                                <td><input type="text" name="email" id="email" class="validate[required,custom[email]]"></td>
                            </tr>
                            <tr>
                                <td>Contraseña del invitado:</td>
                                <td><input type="password" name="pass" id="pass" class="validate[required]"></td>
                            </tr>
                            <tr>
                                <td><input type="submit" value="Invitar"></td>
                            </tr>
                        </table>
                    </form>
                    <div class="clr"></div>
                </div>
            </div>
4

1 回答 1

0

按照这个:

从这里下载 jquery 验证引擎插件。并提取它。

在文件夹中,您可以找到这两个文件。

jquery.validationEngine-en.js 
jquery.validationEngine.js

复制并粘贴到您工作项目的 assets->scripts-> 中。

然后像下面这样改变src路径。

<script src="assets/scripts/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8"></script>

<script src="assets/scripts/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>
于 2013-07-06T09:25:04.877 回答