JQuery外掛程式的使用

來源:互聯網
上載者:User

標籤:

         今天就來總結一下jquery外掛程式的使用

<script src="Jjs/jquery-1.7.1.min.js"></script>    <script src="Jjs/jquery.validate.js"></script>    <!--驗證-->    <script>        $(function () {            $("#form").validate({                rules: {                   //rules是對其值的約束                    txtname: {                        required: true,      //  不可為空                        minlength: 2        //最小長度為2                    },                    txtpwd: {                        required: true,                        minlength: 6          //最小長度為6                    },                    txtapwd: {                        required: true,                        equalTo: "#txtpwd"      //即等於txtpwd的值                    },                    txtaddress: {                        required: true,                    },                    txtbirthday: {                        required: true,                        date: true           //必須為日期類型                    },                    txtemail: {                        required: true,                        email: true           //email格式                    }                },                messages: {                       //重設提示資訊                    txtname: {                        required: "使用者名稱不可為空",                        minlength: "使用者名稱不能少於2個字"                    },                    txtpwd: {                        required: "密碼不可為空",                        minlength: "密碼不能少於6位元"                    },                    txtemail: {                        required: "郵箱不可為空",                        email: "請輸入正確的郵箱地址"                    },                    txtbirthday: {                        required: "生日不可為空",                        date: "請輸入正確的時間"                    },                    txtapwd: {                        required: "請輸入確認密碼",                        equalTo: "兩次輸入密碼不一致"                    },                    txtaddress: {                        required: "地址不可為空"                    }                },            })        })    </script>
 <form action="Registera.ashx" method="post" id="form">        <table>            <tr><td>使用者名稱:</td><td><input type="text" name="txtname" id="txtname"  /></td></tr>            <tr><td>密碼:</td><td><input type="password" name="txtpwd" id="txtpwd"  /></td></tr>            <tr><td>重複密碼:</td><td><input type="password" name="txtapwd" id="txtapwd" /></td></tr>            <tr><td>性別:</td><td>男:<input id="radioman" name="radio" value="man" checked="checked" type="radio" />&nbsp;女:<input id="radiowoman" name="radio" type="radio" value="woman" /></td></tr>            <tr><td>地址:</td><td><input id="txtaddress" name="txtaddress" type="text" /></td></tr>            <tr><td>郵箱地址:</td><td><input id="txtemail" name="txtemail" type="text"  /></td></tr>            <tr><td>出生日期:</td><td><input id="txtbirthday" name="txtbirthday" type="text" /></td></tr>            <tr><td><input id="Submit" type="submit" value="註冊" /></td><td><input id="Reset" type="reset" value="重設" /></td></tr>        </table>    </form>

                          

<link href="css/jquery-ui.css" rel="stylesheet" />  <!--彈出的登入框的樣式-->    <script src="Jjs/jquery-1.7.1.min.js"></script>    <script src="Jjs/jquery-ui-1.8.20.min.js"></script>    <!--用於彈框使用的-->    <script>        $(function () {            $("#loginmess").bind("click", function () {                $("#dialog").dialog({          //彈框,彈出登入的介面                    height: 300,                    width: 300,                    title: ‘登入‘                })            })        })    </script>
<p><span><a href="Register.html">註冊</a></span>&nbsp;&nbsp;<span><a href="#" id="loginmess">登入</a></span></p>    <div id="dialog" style="display:none">       <!--在這裡需要登入框隱藏,當點擊登入時間彈框登入-->         <form  action="login.ashx" method="post">          <table>            <tr>                <td>使用者名稱:</td><td><input type="text" name="txtname" value=" " /></td>            </tr>            <tr>                <td>密碼:</td><td><input type="password" name="txtpwd" value=" " /></td>            </tr>            <tr>                <td colspan="2"><input type="submit" name="submit" value="登入 " /></td>           </tr>        </table>      </form>    </div>

                

JQuery外掛程式的使用

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.