I am faced a problem with validation for duplicate value
checking from server using json.
My code is runing fine in each click but error message show in second
click(One click in side text box put value then click out side the text
box - that time code execute but error message show . again i click in
that text box and again click out side text box ,again my code run and
this time error message show) . Please find my mistake and help me to
show validation message in single escape or single click of text box.
Now I solve by adding ajax async clode in the to of the javascript. We get success if you use this.script language="javascript" type="text/javascript"
//KendoUi Validation
var validatable = $("#ApplicationNo").kendoValidator({
onfocusout: true,
onkeyup: true,
rules: {
ApplicationNo: function (input) {
$.post("/Home/CheckAppNo",
{ ApplicationNo: $("#ApplicationNo").val() },
function (data) { b1 = data; })
return b1;
}
},
messages: {
ApplicationNo: "Already Exist"
}
}).data("kendoValidator");
var validatable =
$(".k-content").kendoValidator().data("kendoValidator");
script language="javascript" type="text/javascript"//KendoUi Validation
$.ajaxSetup({ async: false });
C # Code
Html< input type="text" id="ReferredBy" name="ReferredBy" class="k-textbox" required />
|
No comments:
Post a Comment