How to submit a specific form if multiple forms are present in one page using jquery

后端 未结 6 2076
-上瘾入骨i
-上瘾入骨i 2021-02-14 09:49

I have two forms.

6条回答
  •  日久生厌
    2021-02-14 10:17

    consider the HTML:

        
        
        
        
        
    ....

    The event handler can be bound to the form:

        $('#target').submit(function() {
        alert('Handler for .submit() called.');
        return false;
        });
    

    Click function:

        $('#other').click(function() {
        $('#target').submit();
        });
    

    Here is the link have a look: How can I submit form on button click when using preventDefault()?

提交回复
热议问题