jquery - Refocus a textfield form after an AJAX call -


trying refocus textfield after ajax call, example checking if login choosen taken

$(document).ready(function() {      $("#login").blur(function(){         //ajax here check if login exist         alert("login exist");         $(this).val("");         $(this).focus();     }); });  

the focus not going login, code fail. appreciated.

answer - based on barmar suggestion - thank :d

$(document).ready(function() {      $("#login").blur(function(){          alert($(this).val());         //ajax here check if login exist         $.ajax({                           type: "get",             url: "emptyservlet",                                     success: function(){                     $("#login").val("");                 $("#login").focus();                 }              });      }); });  


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -