Re: [Dev] [DEV] - How to send a AJAX call when User finish typing at the textbox
Hi there, for validation you can use a open source library bootstrapValidation JS . You can make call after validation is onsuccess. https://github.com/nghuuphuoc/bootstrapvalidator I have answer this question generally. Apologize me if any thing wrong with WSO2 APIs. Regards. *M. Nifras Ismail* [image: LinkedIn] http://lk.linkedin.com/pub/nifras-ismail/54/343/94b On Thu, Jul 9, 2015 at 10:50 AM, Irham Iqbal iq...@wso2.com wrote: Hi Rajee, You can use a timer to call back. It will wait for sometime to check whether there is textArea.onkeypress and trigger callback. Reference[1]. [1] http://stackoverflow.com/questions/1620602/javascript-jquery-make-an-ajax-request-when-a-user-is-typing-in-a-textarea Thanks, Iqbal On Thu, Jul 9, 2015 at 10:16 AM, Lakshani Gamage laksh...@wso2.com wrote: Hi Rajee, You can use .onblur()[2] event also. [2] http://www.w3schools.com/jsref/event_onblur.asp Thanks, Lakshani On Thu, Jul 9, 2015 at 9:56 AM, Himasha Guruge himas...@wso2.com wrote: Hi Rajeenthini, You could use a time out or .blur() ( user focus out from the text box) depending on your requirement. You could look into [1]. [1] how-to-trigger-an-event-in-input-text-after-i-stop-typing-writing http://stackoverflow.com/questions/14042193/how-to-trigger-an-event-in-input-text-after-i-stop-typing-writing Thanks, Himasha On Thu, Jul 9, 2015 at 9:52 AM, Thusitha Thilina Dayaratne thusit...@wso2.com wrote: 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 rajeenth...@wso2.com 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=gadgetq= + 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:rajeenth...@wso2.com rajeenth...@wso2.com* *M :+94770832823 %2B94770832823 * ___ Dev mailing list Dev@wso2.org 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 Abouthttp://about.me/thusithathilina ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- Himasha Guruge *Software Engineer* WS*O2* *Inc.* Mobile: +94 777459299 himas...@wso2.com ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- Lakshani Gamage *Software Engineer* Mobile : +94 (0) 71 5478184 %2B94%20%280%29%20773%20451194 ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- Irham Iqbal Software Engineer - Test Automation WSO2, Inc.: http://wso2.com lean. enterprise. middleware phone: +94 777888452 ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] [DEV] - How to send a AJAX call when User finish typing at the textbox
Hi Rajee, I think you can trigger the validation when the textbox looses it's focus. In jquery there is a focusout function. I think you can use it. Just a sample: $('#text1, #textarea1').focusout(function() { alert(this.id + loose the focus); }); Thanks, Hasanthi Dissanayake Software Engineer | WSO2 E: hasan...@wso2.com nirosh...@wso2.com M :0718407133| http://wso2.com http://wso2.com/ On Thu, Jul 9, 2015 at 10:50 AM, Irham Iqbal iq...@wso2.com wrote: Hi Rajee, You can use a timer to call back. It will wait for sometime to check whether there is textArea.onkeypress and trigger callback. Reference[1]. [1] http://stackoverflow.com/questions/1620602/javascript-jquery-make-an-ajax-request-when-a-user-is-typing-in-a-textarea Thanks, Iqbal On Thu, Jul 9, 2015 at 10:16 AM, Lakshani Gamage laksh...@wso2.com wrote: Hi Rajee, You can use .onblur()[2] event also. [2] http://www.w3schools.com/jsref/event_onblur.asp Thanks, Lakshani On Thu, Jul 9, 2015 at 9:56 AM, Himasha Guruge himas...@wso2.com wrote: Hi Rajeenthini, You could use a time out or .blur() ( user focus out from the text box) depending on your requirement. You could look into [1]. [1] how-to-trigger-an-event-in-input-text-after-i-stop-typing-writing http://stackoverflow.com/questions/14042193/how-to-trigger-an-event-in-input-text-after-i-stop-typing-writing Thanks, Himasha On Thu, Jul 9, 2015 at 9:52 AM, Thusitha Thilina Dayaratne thusit...@wso2.com wrote: 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 rajeenth...@wso2.com 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=gadgetq= + 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:rajeenth...@wso2.com rajeenth...@wso2.com* *M :+94770832823 %2B94770832823 * ___ Dev mailing list Dev@wso2.org 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 Abouthttp://about.me/thusithathilina ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- Himasha Guruge *Software Engineer* WS*O2* *Inc.* Mobile: +94 777459299 himas...@wso2.com ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- Lakshani Gamage *Software Engineer* Mobile : +94 (0) 71 5478184 %2B94%20%280%29%20773%20451194 ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- Irham Iqbal Software Engineer - Test Automation WSO2, Inc.: http://wso2.com lean. enterprise. middleware phone: +94 777888452 ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] [DEV] - How to send a AJAX call when User finish typing at the textbox
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 rajeenth...@wso2.com 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=gadgetq= + 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:rajeenth...@wso2.com rajeenth...@wso2.com* *M :+94770832823 %2B94770832823 * ___ Dev mailing list Dev@wso2.org 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 Abouthttp://about.me/thusithathilina ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] [DEV] - How to send a AJAX call when User finish typing at the textbox
Hi Rajeenthini, Can you please share the place, in which you are calling this function? On Thu, Jul 9, 2015 at 9:45 AM, Rajeenthini Satkunam rajeenth...@wso2.com 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=gadgetq= + 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:rajeenth...@wso2.com rajeenth...@wso2.com* *M :+94770832823 %2B94770832823 * ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- Shakila Sivagnanarajah Associate Software Engineer Mobile :+94 (0) 770 760240 shak...@wso2.com ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] [DEV] - How to send a AJAX call when User finish typing at the textbox
Hi Rajee, You can use a timer to call back. It will wait for sometime to check whether there is textArea.onkeypress and trigger callback. Reference[1]. [1] http://stackoverflow.com/questions/1620602/javascript-jquery-make-an-ajax-request-when-a-user-is-typing-in-a-textarea Thanks, Iqbal On Thu, Jul 9, 2015 at 10:16 AM, Lakshani Gamage laksh...@wso2.com wrote: Hi Rajee, You can use .onblur()[2] event also. [2] http://www.w3schools.com/jsref/event_onblur.asp Thanks, Lakshani On Thu, Jul 9, 2015 at 9:56 AM, Himasha Guruge himas...@wso2.com wrote: Hi Rajeenthini, You could use a time out or .blur() ( user focus out from the text box) depending on your requirement. You could look into [1]. [1] how-to-trigger-an-event-in-input-text-after-i-stop-typing-writing http://stackoverflow.com/questions/14042193/how-to-trigger-an-event-in-input-text-after-i-stop-typing-writing Thanks, Himasha On Thu, Jul 9, 2015 at 9:52 AM, Thusitha Thilina Dayaratne thusit...@wso2.com wrote: 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 rajeenth...@wso2.com 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=gadgetq= + 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:rajeenth...@wso2.com rajeenth...@wso2.com* *M :+94770832823 %2B94770832823 * ___ Dev mailing list Dev@wso2.org 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 Abouthttp://about.me/thusithathilina ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- Himasha Guruge *Software Engineer* WS*O2* *Inc.* Mobile: +94 777459299 himas...@wso2.com ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- Lakshani Gamage *Software Engineer* Mobile : +94 (0) 71 5478184 %2B94%20%280%29%20773%20451194 ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- Irham Iqbal Software Engineer - Test Automation WSO2, Inc.: http://wso2.com lean. enterprise. middleware phone: +94 777888452 ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
[Dev] [DEV] - How to send a AJAX call when User finish typing at the textbox
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=gadgetq= + 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:rajeenth...@wso2.com rajeenth...@wso2.com* *M :+94770832823 * ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] [DEV] - How to send a AJAX call when User finish typing at the textbox
Hi Rajee, You can use .onblur()[2] event also. [2] http://www.w3schools.com/jsref/event_onblur.asp Thanks, Lakshani On Thu, Jul 9, 2015 at 9:56 AM, Himasha Guruge himas...@wso2.com wrote: Hi Rajeenthini, You could use a time out or .blur() ( user focus out from the text box) depending on your requirement. You could look into [1]. [1] how-to-trigger-an-event-in-input-text-after-i-stop-typing-writing http://stackoverflow.com/questions/14042193/how-to-trigger-an-event-in-input-text-after-i-stop-typing-writing Thanks, Himasha On Thu, Jul 9, 2015 at 9:52 AM, Thusitha Thilina Dayaratne thusit...@wso2.com wrote: 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 rajeenth...@wso2.com 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=gadgetq= + 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:rajeenth...@wso2.com rajeenth...@wso2.com* *M :+94770832823 %2B94770832823 * ___ Dev mailing list Dev@wso2.org 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 Abouthttp://about.me/thusithathilina ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- Himasha Guruge *Software Engineer* WS*O2* *Inc.* Mobile: +94 777459299 himas...@wso2.com ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- Lakshani Gamage *Software Engineer* Mobile : +94 (0) 71 5478184 %2B94%20%280%29%20773%20451194 ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] [DEV] - How to send a AJAX call when User finish typing at the textbox
Hi Rajeenthini, You could use a time out or .blur() ( user focus out from the text box) depending on your requirement. You could look into [1]. [1] how-to-trigger-an-event-in-input-text-after-i-stop-typing-writing http://stackoverflow.com/questions/14042193/how-to-trigger-an-event-in-input-text-after-i-stop-typing-writing Thanks, Himasha On Thu, Jul 9, 2015 at 9:52 AM, Thusitha Thilina Dayaratne thusit...@wso2.com wrote: 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 rajeenth...@wso2.com 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=gadgetq= + 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:rajeenth...@wso2.com rajeenth...@wso2.com* *M :+94770832823 %2B94770832823 * ___ Dev mailing list Dev@wso2.org 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 Abouthttp://about.me/thusithathilina ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- Himasha Guruge *Software Engineer* WS*O2* *Inc.* Mobile: +94 777459299 himas...@wso2.com ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev