-- Alan Wagstaff <[EMAIL PROTECTED]> wrote
(on Tuesday, 19 February 2008, 06:55 PM +0000):
> Hi all,
>
> On 19/02/2008, Matthew Weier O'Phinney <[EMAIL PROTECTED]> wrote:
> > -- Dennis Becker <[EMAIL PROTECTED]> wrote
> > (on Tuesday, 19 February 2008, 04:29 PM +0100):
> > > But what if I don't want to use 'label' at the submit button? I only want
> > > to
> > > use 'value'.
> >
> > First off, what's happening internally is that the label is used for the
> > element value -- which ends up becoming the *displayed* button value.
> > Label == display, value == value.
>
> Is there an easy way to remove the label that it generates? For
> example (using the latest nightly snapshot), I've just changed my code
> to:
>
> $elements['submit'] = new Zend_Form_Element_Submit('submit');
> $elements['submit']->setLabel('Join PHPSnippets');
> $elements['submit']->setAttrib('class', 'button');
>
> From the old setValue() version and now my form looks like:
>
> http://i77.photobucket.com/albums/j49/citalan/zend_form_submit_label.jpg
>
> Is there a way to remove the blue label "Join PHPSnippets" whilst
> leaving the button text in place?
I'm guessing you must be using setElementDecorators(). :-)
Yes, there's an easy way to remove a decorator:
$form->submit->removeDecorator('Label');
will remove the Label decorator.
(BTW, Button, Reset, and Submit elements no longer use the Errors and
Label decorators currently, as they're typically unnecessary.)
--
Matthew Weier O'Phinney
PHP Developer | [EMAIL PROTECTED]
Zend - The PHP Company | http://www.zend.com/