Issues

ZF-12473: When we refer a form element by its name in the view using getElement() method it throws an error due to incorrect letter case.

Description

If this is a form element,

$checkInDate = $this->createElement("text", "check-in-date"); $checkInDate->setAttrib("id", "check-in-date") ->setAttrib("class", "date-icon") ->setLabel("Arrival Date") ->setRequired(true) ->addValidator("NotEmpty", true, 'This field is required') ->addFilter('HtmlEntities') ->addFilter('StringTrim');

Referring this element by its name like below throws an error,

I.e. $form->getElement('checkInDate');

But below works fine.

$form->getElement('checkindate');

When we create an element Zend_Form stores them in an array, but it seems that the array indexes in which these elements are stored are lower cased and the getElement() method will only work if an argument is passed in lower case (It won't work with uppercase and camel notation).

Comments

Hi,

Please ignore this. I figured out what the problem was and this is not a bug.

Regards, Jay