OnChange on textbox Event calling twice

Posted by Abhi on Stack Overflow See other posts from Stack Overflow or by Abhi
Published on 2012-06-18T11:48:33Z Indexed on 2012/06/18 15:16 UTC
Read the original article Hit count: 195

Filed under:
|
|

I am adding onchange event dynamically using Jqery.. When I am changing the textbox the event is firing twice and two times alert boxes are coming sometimes 3 times.

if(Country.toUpperCase().indexOf("MALAYSIA")!=-1)
{    debugger;
    if(productDesc.toUpperCase().indexOf("SV")!=-1)
    {                   
        $("#<%=txtlAxis.ClientID%>").change(function()
        {         
                if(productDesc.toUpperCase().indexOf("SV")!=-1)
                {                           
                alert('2');
                }
        });  
    }
}

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery