Update Event Handler

Hi Guys,
I am executing my block of code in Js(client-sied) before update and there are conditions and in one condition i have to update and in one condition i have to stop that code and stop updating… i have tried after_save event but it is not stopping update… It updates and submit the document.I have tried these handlers too
Any help will be highly appreciatable

Its solved… and for people who still don’t know it can be only be done by hooks