jQuery.validationEngine v2.6.1
=====
Summary
---
**jQuery validation** engine is a Javascript plugin aimed at the validation of form fields in the browser (IE 6-8, Chrome, Firefox, Safari, Opera 10).
The plugin provides visually appealing prompts that grab user attention on the subject matter.
Validations range from email, phone, and URL, to more complex calls such as ajax processing or custom javascript functions.
Bundled with many locales, the error prompts can be translated into the language of your choice.
![Screenshot](https://github.com/posabsolute/jQuery-Validation-Engine/raw/master/css/screenshot.png)
Documentation :
---
###[Nicer documention](http://posabsolute.github.com/jQuery-Validation-Engine/)
###[Release Notes](http://posabsolute.github.com/jQuery-Validation-Engine/releases.html)
Demo :
---
### http://www.position-relative.net/creation/formValidator/
Installation
---
### What's in the archive?
The archive holds, of course, the core library along with translations in different languages.
It also comes with a set of demo pages and a simple ajax server (built in Java and php).
1. Unpack the archive
2. Include the script jquery.validationEngine.closure.js in your page
3. Pick the locale of the choice and include it in your page: jquery.validationEngine-XX.js
4. **Read this manual** and understand the API
### Running the Demos
Most demos are fully functional by simply opening their respective HTML file. However, the Ajax demos require the use of Java6 to launch a lightweight http server.
1. Run the script `runDemo.bat` (Windows) or `runDemo.sh` (Unix) from the folder
2. Open a browser and point it at [http://localhost:9173](http://localhost:9173)
Usage
---
### References
First include jQuery on your page
```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js" type="text/
javascript"></script>
```
Include *jquery.validationEngine* and its locale
```html
<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>
```
Finally include the desired theme
```html
<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css"/>
```
### Field Validations
Validations are defined using the field's **class** attribute. Here are a few examples showing how it happens:
```html
<input value="someone@nowhere.com" class="validate[required,custom[email]]" type="text" name="email" id="email" />
<input value="2010-12-01" class="validate[required,custom[date]]" type="text" name="date" id="date" />
<input value="too many spaces obviously" class="validate[required,custom[onlyLetterNumber]]" type="text" name="special" id="special" />
```
For more details about validators, please refer to the section below.
#### Experimental attribute data-validation-engine
We are currently in the process of replaceing the class attribute by something more standard, it should normally work but consider this feature in beta.
<input value="someone@nowhere.com" data-validation-engine="validate[required,custom[email]]" type="text" name="email" id="email" />
#### Standard HTML5 attribute for error message
Customize error messages with data-errormessage and data-errormessage-* attributes on the form elements. For example:
```html
<input type="email" name="email" id="email" data-validation-engine="validate[required,custom[email]]"
data-errormessage-value-missing="Email is required!"
data-errormessage-custom-error="Let me give you a hint: someone@nowhere.com"
data-errormessage="This is the fall-back error message."/>
```
The following attribute's value will be loaded for the relative validation rule:
##### data-errormessage-value-missing
* required
* groupRequired
* condRequired
##### data-errormessage-type-mismatch
* past
* future
* dateRange
* dateTimeRange
##### data-errormessage-pattern-mismatch
* creditCard
* equals
##### data-errormessage-range-underflow
* minSize
* min
* minCheckbox
##### data-errormessage-range-overflow
* maxSize
* max
* maxCheckbox
##### data-errormessage-custom-error
* custom
* ajax
* funcCall
##### data-errormessage
* a generic fall-back error message
### Per Field Prompt Direction
Prompt direction can be define using the field's **data** attribute. Here are a few examples showing how it happens:
```html
<input value="http://" class="validate[required,custom[url]] text-input" type="text" name="url" id="url" data-prompt-position="topLeft" />
<input value="" class="validate[required] text-input" type="text" name="req" id="req" data-prompt-position="bottomLeft" />
<input value="too many spaces obviously" class="validate[required,custom[onlyLetterNumber]]" type="text" name="special" id="special" data-prompt-position="bottomRight" />
<input value="" class="validate[required] text-input" type="text" name="req-inline" id="req-inline" data-prompt-position="inline" />
```
If "inline" is applied the prompt is attached after the corresponding input field with position set to "relative". You can specify an optional target container to which the prompt should be attached by providing the id of this container in the field's **data-prompt-target** attribute.
### Prompt Position Adjustment
Prompt position can be adjusted by providing shiftX and shiftY with position type in the field's **data** attribute.
Prompt will be placed in (defaultX+shiftX),(defaultY+shiftY) position instead of default for selected position type.
Here are a few examples showing how it happens:
```html
<input value="http://" class="validate[required,custom[url]] text-input" type="text" name="url" id="url" data-prompt-position="topLeft:70" />
<input value="" class="validate[required] text-input" type="text" name="req" id="req" data-prompt-position="bottomLeft:20,5" />
<input value="too many spaces obviously" class="validate[required,custom[onlyLetterNumber]]" type="text" name="special" id="special" data-prompt-position="bottomRight:-100,3" />
```
### Instantiation
The validator is typically instantiated with a call in the following format, the plugin can only be instanciated on form elements:
```js
$("#form.id").validationEngine();
```
Without any parameters, the init() and attach() methods are automatically called.
```js
$("#form.id").validationEngine(action or options);
```
The method may take one or several parameters, either an action (and parameters) or a list of options to customize the behavior of the engine.
Here's a glimpse: say you have a form as such:
```html
<form id="formID" method="post" action="submit.action">
<input value="2010-12-01" class="validate[required,custom[date]]" type="text" name="date" id="date" />
</form>
```
The code below will instantiate the validation engine and attach it to the form:
```html
<script>
$(document).ready(function(){
$("#formID").validationEngine();
});
</script>
```
When using options, the default behavior is to only initialize ValidationEngine, so attachment needs to be done manually.
```html
<script>
$(document).ready(function(){
$("#formID").validationEngine('attach', {promptPosition : "centerRight", scroll: false});
});
</script>
```
All calls to validationEngine() are chainable, so one can do the following:
```js
$("#formID").validationEngine().css({border : "2px solid #000"});
```
### Suppress Validation Feature
Hyperlink and Button ( <button> and input ) allow suppress the validation for special case such as multi fake submit buttons in web page.
An id attribute for the HTML element is requried.
Syntax (HTML5):
```html
<input id="skipbutton" data-validation-engine-skip="true" type="submit" value="Refresh button"/>
```
Syntax (use class attribute):
```html
<input id="skipbutton" class="submit validate-skip" type="button" value="Refresh button"/>
```
### Using a DIV container instead of a FORM
You can use a div acting as a container using the class *"validationEngineContaine
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
jQuery-Validation-Engine-master.zip (87个子文件)
jQuery-Validation-Engine-master
runDemo.bat 61B
css
screenshot.png 35KB
validationEngine.jquery.css 3KB
customMessages.css 46B
template.css 2KB
.gitignore 138B
README.md 34KB
runDemo.sh 59B
test
NanoHTTPD.java 21KB
AjaxTestServer$AjaxValidationFormResponse.class 5KB
AjaxTestServer.class 8KB
AjaxTestServer.java 6KB
AjaxTestServer$AjaxValidationFieldResponse.class 5KB
NanoHTTPD$Response.class 5KB
NanoHTTPD$HTTPSession.class 6KB
NanoHTTPD.class 7KB
tests
issue507.html 1KB
issue493.html 974B
issue498.html 3KB
issue524.html 1KB
placeholders.html 9KB
issue451.html 1KB
issue480.html 1KB
issue430.html 2KB
demos
demoValidators.ja.html 6KB
demoGlobalSettings.html 3KB
demoAutoHide.html 4KB
demoMultipleForms.html 7KB
demoFieldTypes.html 4KB
demoDatepicker.html 2KB
demoAjaxJAVA.html 4KB
demoErrorLimit.html 2KB
demoAttr.html 3KB
demoHooks.html 3KB
demoPerFieldPromptDirection.html 5KB
demoValidators.html 14KB
demoWithoutId.html 3KB
demoAdjustments.html 2KB
demoRegExp.html 5KB
demoCheckBox.html 4KB
demoShowPrompt.html 2KB
phpajax
ajaxValidateFieldUser.php 612B
ajaxValidateSubmit.php 948B
ajaxValidateFieldName.php 611B
demoOneMessage.html 13KB
demoChosenLibrary.html 15KB
demoAjaxSubmitPHP.html 3KB
demoValidationComplete.html 2KB
demoCustomErrorMessages.html 3KB
demoDivContainer.html 13KB
demoInlineMessages.html 5KB
demoPositioning.html 5KB
demoSilent.html 12KB
demoAjaxInlinePHP.html 3KB
demoLiveEvent.html 4KB
demoOverflown.html 5KB
demoSelectBoxLibrary.html 17KB
demoOnForm.html 2KB
js
jquery-1.8.2.min.js 91KB
languages
jquery.validationEngine-zh_CN.js 11KB
jquery.validationEngine-en.js 10KB
jquery.validationEngine-fr.js 8KB
jquery.validationEngine-it.js 7KB
jquery.validationEngine-hu.js 10KB
jquery.validationEngine-hr.js 11KB
jquery.validationEngine-ro.js 11KB
jquery.validationEngine-ru.js 8KB
jquery.validationEngine-no.js 10KB
jquery.validationEngine-et.js 8KB
jquery.validationEngine-da.js 8KB
jquery.validationEngine-es.js 8KB
jquery.validationEngine-se.js 9KB
jquery.validationEngine-fi.js 7KB
jquery.validationEngine-pt_BR.js 7KB
jquery.validationEngine-ja.js 9KB
jquery.validationEngine-de.js 8KB
jquery.validationEngine-tr.js 9KB
jquery.validationEngine-pl.js 8KB
jquery.validationEngine-nl.js 7KB
jquery.validationEngine-pt.js 10KB
jquery.validationEngine-cz.js 9KB
jquery.validationEngine-fa.js 12KB
jquery.validationEngine-zh_TW.js 11KB
jquery.validationEngine-vi.js 10KB
contrib
other-validations.js 3KB
jquery.validationEngine.js 69KB
index.html 2KB
共 87 条
- 1
雷霄骅
- 粉丝: 4w+
- 资源: 141
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
前往页