add or subtract functions from onSubmit event handler?

后端 未结 4 575
轮回少年
轮回少年 2020-12-21 10:05

I have the following code:

function showAddrBox() {
    var prompt = document.getElementById(\'addr_prompt\');
    prompt.style.display = \'block\';
    docu         


        
4条回答
  •  北荒
    北荒 (楼主)
    2020-12-21 10:31

    What I would do is have one onSubmit function right on the form that orchestrates the rest of the functions, performs logic on what to do when. At the end of that function execution you can return true if you want to proceed with the submission or return false if you don't.

提交回复
热议问题