On 22/10/2010 03:31, Matthew Weier O'Phinney wrote:
-- Mike A<[email protected]> wrote
(on Thursday, 21 October 2010, 10:41 PM +0100):
A Zend_Dojo form would normally produce something like /<form
id="homesaleform" action="saleshelpunloaded" method="post"
class="property-search" dojoType="dijit.form.Form">/.
I have two Zend_Dojo forms on one page. One displays like the above
but the other loses the dojoType="dijit.form.Form" bit. The form
that loses it is almost identical to its sister form (of course,
with different ids etc). The failing form is instantiated within an
action helper in the style of MWO's helpful article at
http://weierophinney.net/matthew/archives/246-Using-Action-Helpers-To-Implement-Re-Usable-Widgets.html...
public function handleLogin()
{
$request = $this->getRequest();
$form = new User_Form_Login();
...
Upon clicking submit my Javascript method produces an "undefined"
error from...
var loginform = dijit.byId(form_id);
if(loginform.isValid()){...
The form_id is fine but with the form dijit missing it fails.
Any ideas about why Zend_Dojo Form fails to render the form dijit
from an action helper but does render what appears to be a Zend form
object?
I need some code to better diagnose the issue. One potential issue is
that the JS code generated may not be taking into account multiple forms
when generating the onClick bindings. The other issue is that you may
not have unique identifiers between the two forms, which could lead to a
conflict when building and binding the forms to events.
Could you paste the two form definitions and how they're invoked
somewhere?
Slow response due to hectic day. I've put something up at
http://pretty-property.com/code/example2.html. I remain baffled!