Jquery to change form action

后端 未结 7 1651
孤城傲影
孤城傲影 2020-11-30 23:45

I have two buttons in a form and two different pages have to be called when they are clicked. when button1 is clicked then page1 must be loaded and when button2 is clicked t

7条回答
  •  萌比男神i
    2020-12-01 00:09

    Try this:

    $('#button1').click(function(){
       $('#formId').attr('action', 'page1');
    });
    
    
    $('#button2').click(function(){
       $('#formId').attr('action', 'page2');
    });
    

提交回复
热议问题