views:

30

answers:

2

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 submitted.

Is it possible with jquery?

+1  A: 

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
});
rahul
i confirm that it works: http://jsbin.com/ikoge (i was wondering whether the fact that it is :hidden would disable it entirely).
pixeline
+1  A: 

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"/>

pixeline