first commit
This commit is contained in:
@ -0,0 +1,50 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Basic ValidateBox - jQuery EasyUI Demo</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
|
||||
<link rel="stylesheet" type="text/css" href="../demo.css">
|
||||
<script type="text/javascript" src="../../jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Basic ValidateBox</h2>
|
||||
<p>It's easy to add validate logic to a input box.</p>
|
||||
<div style="margin:20px 0;"></div>
|
||||
<div class="easyui-panel" title="Register" style="width:400px;padding:10px 60px 20px 60px">
|
||||
<table cellpadding="5">
|
||||
<tr>
|
||||
<td>User Name:</td>
|
||||
<td><input class="easyui-validatebox textbox" data-options="required:true,validType:'length[3,10]'"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Email:</td>
|
||||
<td><input class="easyui-validatebox textbox" data-options="required:true,validType:'email'"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Birthday:</td>
|
||||
<td><input class="easyui-datebox textbox"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>URL:</td>
|
||||
<td><input class="easyui-validatebox textbox" data-options="required:true,validType:'url'"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Phone:</td>
|
||||
<td><input class="easyui-validatebox textbox" data-options="required:true"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<style scoped="scoped">
|
||||
.textbox{
|
||||
height:20px;
|
||||
margin:0;
|
||||
padding:0 2px;
|
||||
box-sizing:content-box;
|
||||
}
|
||||
</style>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,61 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Custom ValidateBox Tooltip - jQuery EasyUI Demo</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
|
||||
<link rel="stylesheet" type="text/css" href="../demo.css">
|
||||
<script type="text/javascript" src="../../jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Custom ValidateBox Tooltip</h2>
|
||||
<p>This sample shows how to display another tooltip message on a valid textbox.</p>
|
||||
<div style="margin:20px 0;"></div>
|
||||
<div class="easyui-panel" title="Register" style="width:400px;padding:10px 60px 20px 60px">
|
||||
<table cellpadding="5">
|
||||
<tr>
|
||||
<td>User Name:</td>
|
||||
<td><input class="easyui-validatebox textbox" data-options="prompt:'Enter User Name.',required:true,validType:'length[3,10]'"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Email:</td>
|
||||
<td><input class="easyui-validatebox textbox" data-options="prompt:'Enter a valid email.',required:true,validType:'email'"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Birthday:</td>
|
||||
<td><input class="easyui-datebox"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>URL:</td>
|
||||
<td><input class="easyui-validatebox textbox" data-options="prompt:'Enter your URL.',required:true,validType:'url'"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Phone:</td>
|
||||
<td><input class="easyui-validatebox textbox" data-options="prompt:'Enter your phone number.',required:true"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<style scoped="scoped">
|
||||
.textbox{
|
||||
height:20px;
|
||||
margin:0;
|
||||
padding:0 2px;
|
||||
box-sizing:content-box;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$(function(){
|
||||
$('input.easyui-validatebox').validatebox({
|
||||
validateOnCreate: false,
|
||||
err: function(target, message, action){
|
||||
var opts = $(target).validatebox('options');
|
||||
message = message || opts.prompt;
|
||||
$.fn.validatebox.defaults.err(target, message, action);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,71 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Error Placement in ValidateBox - jQuery EasyUI Demo</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
|
||||
<link rel="stylesheet" type="text/css" href="../demo.css">
|
||||
<script type="text/javascript" src="../../jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Error Placement in ValidateBox</h2>
|
||||
<p>This example shows how to display the error message below the field.</p>
|
||||
<div style="margin:20px 0;"></div>
|
||||
<div class="easyui-panel" title="Register" style="width:500px;padding:10px 60px 20px 60px">
|
||||
<table class="form-table" cellpadding="5">
|
||||
<tr>
|
||||
<td>User Name:</td>
|
||||
<td><input class="easyui-validatebox textbox" data-options="required:true,validType:'length[3,10]',validateOnCreate:true,err:err"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Email:</td>
|
||||
<td><input class="easyui-validatebox textbox" data-options="required:true,validType:'email',validateOnCreate:false,err:err"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Birthday:</td>
|
||||
<td><input class="easyui-datebox textbox" data-options="required:true,validateOnCreate:false,err:err"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>URL:</td>
|
||||
<td><input class="easyui-validatebox textbox" data-options="required:true,validType:'url',validateOnCreate:false,err:err"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Phone:</td>
|
||||
<td><input class="easyui-validatebox textbox" data-options="required:true,validateOnCreate:false,err:err"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<style scoped="scoped">
|
||||
.textbox{
|
||||
height:20px;
|
||||
margin:0;
|
||||
padding:0 2px;
|
||||
box-sizing:content-box;
|
||||
}
|
||||
.form-table td{
|
||||
vertical-align: top;
|
||||
line-height: 20px;
|
||||
}
|
||||
.error-message{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function err(target, message){
|
||||
var t = $(target);
|
||||
if (t.hasClass('textbox-text')){
|
||||
t = t.parent();
|
||||
}
|
||||
var m = t.next('.error-message');
|
||||
if (!m.length){
|
||||
m = $('<div class="error-message"></div>').insertAfter(t);
|
||||
}
|
||||
m.html(message);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,57 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Validate On Blur - jQuery EasyUI Demo</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
|
||||
<link rel="stylesheet" type="text/css" href="../demo.css">
|
||||
<script type="text/javascript" src="../../jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Validate On Blur</h2>
|
||||
<p>Active validation on first blur event.</p>
|
||||
<div style="margin:20px 0;"></div>
|
||||
<div class="easyui-panel" title="Register" style="width:400px;padding:10px 60px 20px 60px">
|
||||
<table cellpadding="5">
|
||||
<tr>
|
||||
<td>User Name:</td>
|
||||
<td><input class="textbox" data-options="required:true,validType:'length[3,10]',novalidate:true"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Email:</td>
|
||||
<td><input class="textbox" data-options="required:true,validType:'email',novalidate:true"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Birthday:</td>
|
||||
<td><input class="textbox" data-options="required:true,novalidate:true"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>URL:</td>
|
||||
<td><input class="textbox" data-options="required:true,validType:'url',novalidate:true"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Phone:</td>
|
||||
<td><input class="textbox" data-options="required:true,novalidate:true"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('input.textbox').validatebox().bind('blur', function(){
|
||||
$(this).validatebox('enableValidation').validatebox('validate');
|
||||
});
|
||||
})
|
||||
</script>
|
||||
<style scoped="scoped">
|
||||
.textbox{
|
||||
height:20px;
|
||||
margin:0;
|
||||
padding:0 2px;
|
||||
box-sizing:content-box;
|
||||
}
|
||||
</style>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user