Latest web development tutorials
×

jQuery EasyUI Tutorial

jQuery EasyUI Tutorial jQuery EasyUI Introduction

jEasyUI application

jEasyUI Create a CRUD application jEasyUI Create a CRUD data grid jEasyUI Form CRUD application jEasyUI Create an RSS reader

jEasyUI Drag and drop

jEasyUI Basic drag and drop jEasyUI Create a drag-and-drop shopping cart jEasyUI Create a school curriculum

jEasyUI Menus and buttons

jEasyUI Create a simple menu jEasyUI Create a link button jEasyUI Create a menu button jEasyUI Create a split button

jEasyUI layout

jEasyUI Create a border layout jEasyUI Create a complex layout jEasyUI Creates a fold panel jEasyUI Create a tab page jEasyUI Dynamically add a tab jEasyUI Add the AutoPlay tab jEasyUI Create the XP style left panel

jEasyUI Data grid

jEasyUI Convert HTML tables to data grids jEasyUI Get the selected row data jEasyUI Add the query function jEasyUI Add a toolbar jEasyUI Create complex toolbars jEasyUI Sets the frozen column jEasyUI Dynamically change columns jEasyUI Format the column jEasyUI Set sort jEasyUI Custom sorting jEasyUI Create a column combination jEasyUI Add a check box jEasyUI Custom tab jEasyUI Enable in-line editing jEasyUI Extension editor jEasyUI Column operation jEasyUI Merge Cells jEasyUI Create a custom view jEasyUI Create a footer summary jEasyUI Condition Sets the line background color jEasyUI Create an attribute grid jEasyUI The extended line shows the details jEasyUI Create a subgrid jEasyUI Display massive data jEasyUI Add a paging component

jEasyUI window

jEasyUI Create a simple window jEasyUI Customize the Window Toolbar jEasyUI Window and layout jEasyUI Create a dialog box jEasyUI Customize the dialog box

jEasyUI Tree menu

jEasyUI Use the markup to create a tree menu jEasyUI Create an asynchronous tree menu jEasyUI Tree menu to add nodes jEasyUI Create a tree menu with check boxes jEasyUI Tree menu drag and drop control jEasyUI The Tree menu loads the parent / child nodes jEasyUI Create the base tree grid jEasyUI Create a complex tree grid jEasyUI Dynamic loading of tree jEasyUI The tree grid adds pagination jEasyUI Tree-lazy lazy-loading node

jEasyUI Form

jEasyUI Create an asynchronous submission form jEasyUI Form validation jEasyUI Create a tree drop-down box jEasyUI Format the drop-down box jEasyUI Filter down the data grid

jEasyUI Reference Manual

jQuery EasyUI Plugin jQuery EasyUI Extended

jQuery EasyUI form plugin - Validatebox verification box

jQuery EasyUI plugin jQuery EasyUI plugin

By $ .fn.validatebox.defaults override the default defaults.

Verify box (validatebox) in order to validate form input fields and design. If the user enters an invalid value, it will change the background color, the icon displays a warning message and prompt. Verify box (validatebox) can be integrated with the form (form) plug-in, to prevent the submission of invalid field.

rely

  • tooltip

usage

Create a verification mark from the box (validatebox).

<Input id = "vv" class = "easyui-validatebox" data-options = "required: true, validType: 'email'">

Create a validation using javascript box (validatebox).

<Input id = "vv">
$ ( '# Vv'). Validatebox ({
    required: true,
    validType: 'email'
});

Check the password and re-enter the same password.

// Extend the 'equals' rule
$ .extend ($. Fn.validatebox.defaults.rules, {
    equals: {
		validator: function (value, param) {
			return value == $ (param [0]) val ().;
		},
		message: 'Field do not match.'
    }
});
<Input id = "pwd" name = "pwd" type = "password" class = "easyui-validatebox" data-options = "required: true">
<Input id = "rpwd" name = "rpwd" type = "password" class = "easyui-validatebox"
    required = "required" validType = "equals [ '# pwd']">

Validation rules

Validation rules by using the required attributes to define and validType, here is the rules that have been implemented:

  • email: email matching regular expression rules.
  • url: URL matching regular expression rules.
  • length [0,100]: Allows from x to y characters.
  • remote [ 'http: //.../action.do','paramName']: send ajax request to verify the value of a successful return 'true'.

To customize the validation rules, rewrite $ .fn.validatebox.defaults.rules, to define a verification function and ineffective information. For example, the definition of a minLength Authentication Type:

$ .extend ($. Fn.validatebox.defaults.rules, {
    minLength: {
		validator: function (value, param) {
			return value.length> = param [0];
		},
		message: 'Please enter at least {0} characters.'
    }
});

Now you can use this type of authentication to define a minLength enter at least five characters in the input box:

<Input class = "easyui-validatebox" data-options = "validType: 'minLength [5]'">

Attributes

名称 类型 描述 默认值
required boolean 定义是否字段应被输入。 false
validType string,array 定义字段的验证类型,比如 email、url,等等。可能的值:
1、验证类型字符串,应用单个验证规则。
2、验证类型数组,应用多个验证规则。单个字段上的多个验证规则自版本 1.3.2 起可用。

代码实例:
<input class="easyui-validatebox" data-options="required:true,validType:'url'">
<input class="easyui-validatebox" data-options="
	required:true,
	validType:['email','length[0,20]']
">
null
delay number 延迟验证最后的输入值。该属性自版本 1.3.2 起可用。 200
missingMessage string 当文本框为空时出现的提示文本。 该字段是必需的。
invalidMessage string 当文本框的内容无效时出现的提示文本。 null
tipPosition string 定义当文本框的内容无效时提示消息的位置。可能的值:'left'、'right'。该属性自版本 1.3.2 起可用。 right
deltaX number 在 X 方向的提示偏移。该属性自版本 1.3.3 起可用。 0
novalidate boolean 当设置为 true 时,则禁用验证。该属性自版本 1.3.4 起可用。 false

method

名称 参数 描述
destroy none 移除并销毁该组件。
validate none 进行验证以判定文本框的内容是否有效。
isValid none 调用 validate 方法并且返回验证结果,true 或者 false。
enableValidation none 启用验证。该方法自版本 1.3.4 起可用。
disableValidation none 禁用验证。该方法自版本 1.3.4 起可用。

jQuery EasyUI plugin jQuery EasyUI plugin