jQuery Real Person驗(yàn)證碼插件防止表單自動(dòng)提交
本文介紹的jQuery插件有點(diǎn)特殊,防自動(dòng)提交表單的驗(yàn)證工具,就是我們經(jīng)常用到的驗(yàn)證碼工具,先給大家看看效果。
效果圖如下:
使用說明
需要使用jQuery庫文件和Real Person庫文件
同時(shí)需要自定義驗(yàn)證碼顯示的CSS樣式
使用實(shí)例
1、包含文件部分
<script type="text/javascript" src="jquery-latest.pack.js"></script>
<script type="text/javascript" src="jquery.realperson.js"></script>
<style type="text/css">@import "jquery.realperson.css";</style>
2、HTML部分
<input type="text" id="biuuu" name="defaultReal">
3、Javascript部分
$("#biuuu").realperson();
如上實(shí)例,就可以實(shí)現(xiàn)一個(gè)防自動(dòng)提交表單的驗(yàn)證碼工具,同時(shí)可指定驗(yàn)證碼字符的長度,如下:
$("#biuuu").realperson({length: 5});
今天所講到的jQuery Real Person Plugin,就是一個(gè)完全由JavaScript編寫而成的jQuery驗(yàn)證碼插件。
jQuery插件Real Person 點(diǎn)擊可刷新實(shí)例講解
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.realperson.js"></script> <link href="jquery.realperson.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> $(function(){ $('#Gideon').realperson({length: 5}); }) </script> </head> <body> <input type="text" id="Gideon" name="defaultReal"> </body> </html>
注:如果持續(xù)無法驗(yàn)證成功的話,請(qǐng)嘗試下面的方法:
<?php function rpHash($value) { $hash = 5381; $value = strtoupper($value); for($i = 0; $i < strlen($value); $i++) { $hash = (($hash << 5) + $hash) + ord(substr($value, $i)); } return $hash; } ?>
替換為:
<? function rpHash($value) { $hash = 5381; $value = strtoupper($value); for($i = 0; $i < strlen($value); $i++) $hash = (leftShift32($hash, 5) + $hash) + ord(substr($value, $i)); return $hash; } function leftShift32($number, $steps) { $binary = decbin($number); $binary = str_pad($binary, 32, "0", STR_PAD_LEFT); $binary = $binary.str_repeat("0", $steps); $binary = substr($binary, strlen($binary) - 32); return ($binary{0} == "0" ? bindec($binary) : -(pow(2, 31) - bindec(substr($binary, 1)))); } ?>
以上就是為大家介紹了jQuery驗(yàn)證碼插件Real Person的使用方法,小編整理的可能有些不全面,希望大家多多諒解。
- Jquery插件easyUi表單驗(yàn)證提交(示例代碼)
- jquery+ajax驗(yàn)證不通過也提交表單問題處理
- jQuery中驗(yàn)證表單提交方式及序列化表單內(nèi)容的實(shí)現(xiàn)
- jquery validate和jquery form 插件組合實(shí)現(xiàn)驗(yàn)證表單后AJAX提交
- 基于jQuery實(shí)現(xiàn)表單提交驗(yàn)證
- jquery實(shí)現(xiàn)表單驗(yàn)證并阻止非法提交
- jQuery EasyUI提交表單驗(yàn)證
- jQuery form插件之formDdata參數(shù)校驗(yàn)表單及驗(yàn)證后提交
- Jquery練習(xí)之表單驗(yàn)證實(shí)現(xiàn)代碼
- Jquery表單驗(yàn)證失敗后不提交的解決方法
相關(guān)文章
jquery實(shí)現(xiàn)獲取具體時(shí)間(年月日)后3個(gè)月+1天的年月日
這篇文章主要為大家詳細(xì)介紹了jquery如何實(shí)現(xiàn)獲取具體時(shí)間(年月日)后3個(gè)月+1天的年月日,文中的示例代碼講解詳細(xì),有需要的小伙伴可以參考一下2023-11-11jQuery實(shí)現(xiàn)右鍵菜單、遮罩等效果代碼
這篇文章主要介紹了jQuery實(shí)現(xiàn)右鍵菜單、遮罩、彈出層效果,適應(yīng)管理系統(tǒng)界面,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2016-09-09jQuery右側(cè)選項(xiàng)卡焦點(diǎn)圖片輪播特效代碼分享
這篇文章主要介紹了jQuery右側(cè)選項(xiàng)卡焦點(diǎn)圖片輪播特效,一段清新可愛的焦點(diǎn)圖輪播代碼,有需要的小伙伴可以參考下2015-09-09js實(shí)現(xiàn)圖片放大縮小功能后進(jìn)行復(fù)雜排序的方法
這是一個(gè)基于jquery的圖片效果,它的作用是:當(dāng)圖片點(diǎn)擊變大(變小)時(shí),其它圖片按照一定的規(guī)則進(jìn)行排序運(yùn)動(dòng)2012-11-11ASP.NET MVC中EasyUI的datagrid跨域調(diào)用實(shí)現(xiàn)代碼
因?yàn)閑asyUI使用的是JQuery的異步方法加載數(shù)據(jù),應(yīng)該遵循JQuery的跨域訪問規(guī)則2012-03-03jquery 判斷div show的狀態(tài)實(shí)例
下面小編就為大家?guī)硪黄猨query 判斷div show的狀態(tài)實(shí)例。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧,祝大家游戲愉快哦2016-12-12