Jquery trap form submit()

前端 未结 4 1677
长情又很酷
长情又很酷 2021-01-02 00:58

I\'m currently using jquery to trap the submission of a form and show users a dialog for confirmation. If user clicks yes, then form should submit. If user clicks no, then c

4条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-02 01:36

    I would make something either a namespaced global, or a value from some hidden input like so:

    var something = nameSpaced.something ||  $('#hiddenInput').val(); //your choice
    if (something) {
        ...
    } ...
    

    Your logic should work normally then.

提交回复
热议问题