Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi,

I am developing a web portal where I want to check a value of a textbox once the user finished typing in it and leaves it. I want something like textbox leave event. I want to check its value against the value in a SQL server database table. I have tried using the text changed event while keeping the autopostback = true. But still it is not working.
Can anyone help me please................
Posted
Updated 16-Apr-13 2:01am
v2
Comments
Ra3IDeN 16-Apr-13 8:09am    
Have you tried clicking outside of the textbox when you have typed in your value?
Vreeti 16-Apr-13 9:06am    
Yes.. I had tried this...
[no name] 16-Apr-13 13:42pm    
kindly post your code please

onblur event u can called by javascript, and use webservice method to retrieve value from database and compare it at client side only. for reference click here
how javascript use to call server side sql queries using webservice
 
Share this answer
 
dude i think you have to use jquery ajax .
JavaScript
$("#txtID").blur(function(){

    var text=$("#txtID").val();

    $.ajax({
        url:"Default.aspx/WebMethod",
        type:"POST",
        data:{value:text},
        success:function(data){
        alert('done');
        },
        error:function(msg){
          alert('error');
        }
    });
});
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900