Hi Rajeenthini,

I think you can use jquery focusout method to detect when the textfiled
focus get put.
That might help https://api.jquery.com/focusout/

Thanks

On Thu, Jul 9, 2015 at 9:45 AM, Rajeenthini Satkunam <[email protected]>
wrote:

> Hi all,
>
> Currently I am working on a task validating CRUD forms of Enterprise store
> publisher.So I need to check with the overview name is already exists or
> not.So I will make a AJAX call through server side to get the exactly
> matching asset in the publisher.I am using jQuery validation plugin as well
> as I have an custom method to validate this overview name field on the
> client side.
>
> //custom validator for remote ajax call to validate asset name
> $.validator.addMethod("FieldValidate", function (value, element) {
>     var data = '%22name%22 : %22' + value + '%22';
>     var result = false;
>     $.ajax({
>         type: "GET",
>         url: caramel.url("/apis/assets?type=gadget&q=" + data),
>         dataType: "json",
>         async: false,
>         success: function (data, textStatus, xhr) {
>             var obj = data;
>             if (obj.list.length > 0) {
>                 result = false;
>             } else {
>                 result = true;
>             }
>         },
>         error: function (xhr, thrownError) {
>             console.log("error " + xhr.responseText + "  " + thrownError);
>         }
>     });
>     return result;
>
> }, "The name already taken");
>
> By the way I need to trigger the validation only if the user finish typing
> at the text box.But now the Ajax call sends for each and every input those
> are given by user.So can anyone suggest me any idea to handle this?
> Suggestion would appreciate.
> --
>
> *Thank You.*
>
> *Rajeenthini Satkunam*
>
> *Associate Software Engineer | WSO2*
>
>
> *E:[email protected] <[email protected]>*
>
> *M :+94770832823 <%2B94770832823>   *
>
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Thusitha Dayaratne
Software Engineer
WSO2 Inc. - lean . enterprise . middleware |  wso2.com

Mobile  +94712756809
Blog      alokayasoya.blogspot.com
About    http://about.me/thusithathilina
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to