一款基於jQuery的帶Tooltip表單驗證的註冊表單

來源:互聯網
上載者:User

標籤:

今天給大家分享一款基於jQuery的註冊表單,這款註冊表單的特點是確認提交註冊資訊時,表單會自動驗證所填寫的資訊,如果資訊填寫有誤,即會在相應的欄位內以Tooltip提示框的形式顯示錯誤資訊。這款jQuery表單實現非常簡單,使用起來相對比較輕巧。

線上預覽   源碼下載

這款外掛程式js要引用jquery.js庫,還有一個easyform.js 庫。

html代碼部分如下:

    <div class="form-div">        <form id="reg-form" action="" method="post">        <table>            <tr>                <td>                    使用者名稱                </td>                <td>                    <input name="uid" type="text" id="uid" easyform="length:4-16;char-normal;real-time;"                        message="使用者名稱必須為4—16位的英文字母或數字" easytip="disappear:lost-focus;theme:blue;" ajax-message="使用者名稱已存在!">                </td>            </tr>            <tr>                <td>                    密碼                </td>                <td>                    <input name="psw1" type="password" id="psw1" easyform="length:6-16;" message="密碼必須為6—16位"                        easytip="disappear:lost-focus;theme:blue;">                </td>            </tr>            <tr>                <td>                    確認密碼                </td>                <td>                    <input name="psw2" type="password" id="psw2" easyform="length:6-16;equal:#psw1;"                        message="兩次密碼輸入要一致" easytip="disappear:lost-focus;theme:blue;">                </td>            </tr>            <tr>                <td>                    email                </td>                <td>                    <input name="email" type="text" id="email" easyform="email;real-time;" message="Email格式要正確"                        easytip="disappear:lost-focus;theme:blue;" ajax-message="這個Email地址已經被註冊過,請換一個吧!">                </td>            </tr>            <tr>                <td>                    暱稱                </td>                <td>                    <input name="nickname" type="text" id="nickname" easyform="length:2-16" message="暱稱必須為2—16位"                        easytip="disappear:lost-focus;theme:blue;">                </td>            </tr>        </table>        <div class="buttons">            <input value="注 冊" type="submit" style="margin-right: 20px; margin-top: 20px;">            <input value="我有帳號,我要登入" type="button" style="margin-right: 45px; margin-top: 20px;">        </div>        <br class="clear">        </form>    </div>    <script type="text/javascript">        $(document).ready(function () {            $(‘#reg-form‘).easyform();        });    </script>

via:http://www.w2bc.com/Article/13972

一款基於jQuery的帶Tooltip表單驗證的註冊表單

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.