Stopping onclick from firing when onclientclick is false?

前端 未结 5 839
我在风中等你
我在风中等你 2020-11-30 10:45

Is it possible to use the onclientclick property of a button to do a clientside check. If the check returns true, then fire the onclick

5条回答
  •  -上瘾入骨i
    2020-11-30 11:33

    Sure. If you use return false within your OnClientClick it will prevent any navigation from happening. So you're code would look like:

    
    

提交回复
热议问题