开发者

How to submit info from 2 submit button but from one button through jquery?

I have 2 SUBMIT button in a form one is display:hidden and one is display:block

if user click on SUBMIT button (display:block) then another SUBMIT button {display:hidden} should also submitte开发者_StackOverflow社区d.

Is it possible with jquery?


You can trigger the other button click using trigger. Something like

$("#btn1").click(function(){
    // event handler for button 1
    $("#btn2").trigger("click"); // trigger button 2 click event handler
});

$("#btn2").click(function(){
    // event handler for button 2
});


That does not make sense: either you need 2 actions to be formed, and so, you solve it through your serverside processing script, or you need that second button value, in such case you use it as "hidden" input field <input type="hidden" name="foo" value="bar"/>

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜