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

后端 未结 7 1153
鱼传尺愫
鱼传尺愫 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:08

    for some reason, although I didn't have any jquery event handlers attached, it didn't work.

    What actually worked was:

    OnClientClick="if (validate_form() == false) return(false);"
    

提交回复
热议问题