版权声明:本文为博主原创文章,未经博主允许也可以得转载。 https://blog.csdn.net/zrcshendustudy/article/details/81738162
easyui的表单绑定,失去焦点弹出值核心代码:
1,
<input type="text" class="easyui-textbox" id="name" maxlength="5" style="width:150px"/>
$(function()
{
$("input",$("#name").next("span")).blur(function()
{
alert("ok");
});
});
2.失去焦点事件处理:ction()dd
$(function()
{
$("input",$("#templateKey1").next("span")).blur(function()
{
var templateKey1=$("#templateKey1").val();
$.ajax({
url:basePath + "component/excel/template/selectTemplateKey",
type : "get",
async : false,
contentType : 'application/json;charset=UTF-8',
success : function(data) {
alert(data);
var flag=false;
for(var i=0;i<data.length;i++){
if(templateKey1==data[i]){
flag=true;
}
}
if(flag==true){
if(templateKey1==="${param.templateKey}"){
}else{
$("#templateKey1").textbox('setValue','');
}
}
},
error : function(xhr) {
alert("失败了");
return "false";
}
});
});
});
{
$("input",$("#name").next("span")).blur(function()
{
alert("ok");
});
});
<input type="text" class="easyui-textbox" id="name" maxlength="5" style="width:150px"/>
$(function()
{
$("input",$("#name").next("span")).blur(function()
{
alert("ok");
});
});