how to cancle click event of a button, which executes after lostfocus of textbox element.

how to cancle click event of a button, which executes after lostfocus of textbox element.

hi,

    I have a textbox and a button, with this I have written a focusout event of textbox which calls a function which returns true or false.

and I have written one click event of the button.

now I want to cancel the click event of the button if the function which is called in focusout returns false else it should follow the natural chain of events.

and the problem is worse because I have many buttons and checkboxes which have got click events or other events too. so I want to find the next event which can execute after focusout and  then cancel it  as per the case.

    pls answer for jquery and javascript both.