Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the value of a Zend_Form_Element_Submit

I have several forms which the only difference is the text in the submit button.
I am trying to change the Submit text by changing it's value, but to no avail.

$form=getForm()//get a full Zend_Form object with elements.
$form->getElement('mySubmit')->setValue('new value');
....
....
$form->render(); //This will still put 'mySubmit' in the [submit] (var_dumping it shows the new value in the _value member, tried also with setAttrib();

And this one:

$form=getForm()//get a full with elements Zend_Form object.
$form->getElement('mySubmit')->setName('new value');
....
....
$form->render(); //This will still put 'newvalue' in the [submit] NO SPACES, no good :-(
like image 944
Itay Moav -Malimovka Avatar asked Dec 31 '22 00:12

Itay Moav -Malimovka


1 Answers

$form->getElement('mySubmit')->setLabel('new value')

Does this accomplish what you're looking for?

like image 198
great_llama Avatar answered Jan 08 '23 05:01

great_llama