hi,
I am trying to implement serverside duplicated names checking,
my idea is to immediately show the validation error, on blur
here is the general flow,
1. user types the name;
2. custom validation function call dataAdapter.dataBind()
3. show the validation error if the name already exists.
here is the piece of validation code
{
input : ‘#typeName’,
message : ‘type already exists’,
action : ‘blur’,
rule : function (input) {
var type = $(‘#typeCode’).val();
var typeName = $(‘#typeName’).val();
if(type==” || typeName==”)
return true;
else
{
var checkLink = ‘/type/checktype/’+type+’/’+typeName;
typechecksource.url = checkLink;
typeCheckAdapter.source = typechecksource;
typeCheckAdapter.dataBind();
if(isDuplicate==1)
return false;
return true;
}
}
},
The problem is that the dataAdpater can not set the ‘isDuplicate’ variable on-time, even though I set async:false for dataadapter.
please help if I am going the wrong way.
Thanks