ASP.NET OnClientClick=“return false;” doesn't work

后端 未结 7 1147
鱼传尺愫
鱼传尺愫 2020-12-18 23:55

I just want to add some client side (JQuery Javascript) validation in a web user control. I put an OnClientClick handler and the function gets called. BUT, even if I return

7条回答
  •  北海茫月
    2020-12-19 00:11

    oddly enough this worked for me:

    OnClientClick="javascript:SubmitTableData(); return CanSubmit();"
    

    set the return value submit with the first function call:

    function CanSubmit() {    
        return submit;
    }
    

    Hope this helps someone.

提交回复
热议问题