Quantcast

Zend_Dojo_Form failing to submit

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Zend_Dojo_Form failing to submit

paulodgomes
This post has NOT been accepted by the mailing list yet.
The more i use Zend_Dojo_Form the more is see it lacks the quality to be included in the framework...
Here's the thing, I have a Zend_Dojo_Form_Element_TextBox in a Zend_Dojo_Form, if i put some text on it, when clicking submit, everything goes fine. But if i leave the field empty, clicking the submit button won't post the form and just set focus to the first empty textbox. (Tried using native Zend_Form submit button and Zend_Dojo_Form submit button, both have the same behavior).

Try using a form having this and see it for yourself:
public function init() {
      $this->setName('employeedetails');
     
      $employeename = new Zend_Dojo_Form_Element_TextBox('employeename');
      $employeename->setLabel('Name');
     
      $submit = new Zend_Dojo_Form_Element_SubmitButton('employeedetailssubmit');
      $submit->setLabel('Save');
     
      $this->addElements(array($employeename, $submit));
}

A different setup, but having the same result, is including a Zend_Dojo_Form_Element_CheckBox in the form. The form won't submit if this kind of element is present in the form.
Please advise on how to overcome this.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Zend_Dojo_Form failing to submit

paulodgomes
This post was updated on .
Forgot to mention that am running an hybrid.
Zend 1.11.11 and Dojo 1.7.2

Maybe that's the issue, but nevertheless, i'd rather patch something than rewrite lots of code...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Zend_Dojo_Form failing to submit

paulodgomes
Just found the root cause for this and here's the solution/explanation in case someone bumps here:

Just check ZF-11953 on Zend's Issue Tracker

http://framework.zend.com/issues/browse/ZF-11953

A comment on that ticket:
MediaXtend wrote
The problem is that when Dojo parse page's Dijits, it sometimes adds the required="true" or required="false" attribute on some of the form's elements.
Since this attribute doesn't exists in HTML4 nor in XHTML1, new browsers (like Firefox or Chrome) is using the attribute in its HTML5 form, discarding the "true" or "false" value. So the form needs to have all the Dijits with the attribute "required" to be filled to be submitted.
Loading...