Hi All,

I have implemented a class that extends Zend_Form that looks something like
this:

class MyForm extends Zend_Form {
  public function __construct(User $user, $purpose){
    parent::__construct();
    $this->createCommonElements();
    $this->applyPurposeModifications($purpose);
    $this->applyRoleModifications($user->getRoleId());
  }
  ...
}

In the createCommonElements method I have a bunch of $this->addElement()
calls where I build all the possible form elements.

In applyPurposeModifications, I make changes to the form based on the
purpose for which it is being rendered.  For example, I have a 'view'
purpose that loops through all the form's elements and uses
setAttrib('disabled', true) to merely render the form for
viewing/non-editing purposes.

The problem that I have is when I loop through all the form's elements and
set them as disabled, it also catches my submit button and renders that
useless.  What I want to do is to change the submit button to an edit button
which will be used to trigger some dojo script to make the form elements
editable, etc.

However, everything I've tried to re-enable the submit button after going
through the initial loop of all the form elements has had no effect - please
help...

Thanks in advance,
Erik
-- 
View this message in context: 
http://www.nabble.com/Re-Enabling-previously-disabled-form-submit-button-tp21023701p21023701.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to