|
|||
|
hello,
I'm using a form with 2 submit buttons and I want to know witch one was clicked on. I found on google that you can use de methode isChecked(), but this always return false: PHP Code:
greets, BlaCK ErrOR |
|
|||
|
Without seeing the rest of your code, that's fairly difficult to say.
Quote:
|
|
|||
|
PHP Code:
PHP Code:
|
|
|||
|
Believe it or not, this is actually much easier than it sounds.
If you have multiple submit buttons with the same name but different values, the form will automagically assign the value of the pressed button to that name. So... Code:
<FORM action="./" method="post"> <INPUT type="text" name="whatever"> <INPUT type="submit" name="formsubmit" value="one"> <INPUT type="submit" name="formsubmit" value="two"> <INPUT type="submit" name="formsubmit" value="three"> </FORM> And.... PHP Code:
Sorry I'm not specifically using Zend_Form in my examples, I rarely use it myself. But, this is just an example. One major disclaimer, however: If you are submitting the form through an Ajax request, this may be iffy!! I know for a fact that Prototype's Form.serialize() can't handle which one was pressed. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|