I have an asp.net page that contains a gridview within an update panel. On this Gridview there is a number of Textboxes. One of these textboxes causes a postback when it loses focus (textChanged event) and the updatepanel does a postback. I want this textboxes only to do a postback if there are 20 characters in it when it loses focus. I have written a javascript function to do this but I still have a problem. When I do the postback the whole page reloads, not only the update panel. I had something like the below function, can anyone explain how I can get it to only postback the update panel:
<script language='Javascript'>
function CheckPostback(var textbox)
{
if(textbox.value.length() == 20)
{
__doPostBack(textbox.Id, '');
}
}
</script>