Javascript for a form on the server-side?

前端 未结 2 1186
离开以前
离开以前 2021-01-26 10:54

The question emerges from the discussion with Christoph in my last question \'HTML: target=”_blank” for a drop-down list\' and the alternative method by Andrew.

2条回答
  •  执笔经年
    2021-01-26 11:41

    There's no need for any additional code or checking for scripting on the server side: Because of the return false in the onsubmit handler, the form won't be submitted if the handler is executed!

    Returning false from event handlers supresses the default action associated with the event the same way as calling event.preventDefault() (event.returnValue = false in IE) does.

提交回复
热议问题