Hi,
I'm stuck with a strange problem.
I have used 4 submit buttons on my form with different submit callbacks.
But clicking on any of the first three buttons are executing the third button's callback. And the fourth button is executing its own correct callback.
Is this some kind of a bug? Please help.
Comments
Comment #1
prashant_nair commentedAlso, the #value attributes of the first three buttons are the same.
My objective is to have a form with which I can upload 3 different files.
So I'm keeping the #value as 'Upload' for all the three Upload buttons.
Since clicking on any of the buttons produces the same value in $_POST['op'], I have given different submit callbacks for the three submit buttons.
What am I doing wrong?
Comment #2
damien tournoud commentedYou have to give your buttons either a different #value or a different #name. How could Drupal differentiate them if you don't?
Comment #3
prashant_nair commentedThat was really silly on my part.
Didnt know that submit buttons have #name=>'op' by default. Doh!