Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
180
how do I cancel the TextChanged event
posted

function txtMsg_TextChanged(sender, eventargs){

if (x==1)
    oEvent.cancel=true;   <------There is no oEvent parm, what do I do?????

 

}

Parents
  • 12025
    Suggested Answer
    posted

    You can use the ValueChanging event to cancel a value change by the user, or if you want to cancel a key stroke then handle the KeyDown event and cancel that. Here is an example.

    function

    lblMsg_ValueChanging(sender, eventargs) {

    eventargs.set_cancel(true);

    }

    function lblMsg_keyDown(sender, eventargs) {

    eventargs.set_cancel(true);

    }

    So, if you want to cancel input after the user is done entering the value then use ValueChanging & if you want to validate each key stroke then use KeyDown.

    HTH,

    Taz.

     

     

Reply Children