tags:

views:

29

answers:

1

Hi,

Facing one major problem related to cache.

I have User Creation form in that , if i put value which is already used in textfield then it does not shows "Check Availability" hyper link. but if i put new text then it show hyper link on change of textfield value event.

Code is written in Jquery. I think it's issue of data cache .What is the solution.

If i clear all data from Tool >> Internet Option then it works fine first time Here is the code

$('#userName').change(function(){
        if($('#userName').val()!= BLANK_STRING){            
            $('#checkUser').show();         
        }else{
            $('#checkUser').hide(); 
        }   
        $('#avilabilityMsg').html(''); 
    }); 

Please help?

A: 

This might be best suited for the keyup event.

$(function(){
  var userName=$('#userName'), checkUser=$('#checkUser');
  userName.keyup(function(e){
    checkUser[($(this).val()===BLANK_STRING ? 'hide' : 'show')]();
  });
});
czarchaic
sorry it will fire every time on keyup event.
Yashwant Chavan
Yeah..that's the point..did you downvote me???
czarchaic