2008/9/30 Matthew Weier O'Phinney <[EMAIL PROTECTED]>:
>> I mean that I added 3 empty arrays to this line:
>> $oEmail = new Zend_Dojo_Form_Element_ValidationTextBox('email',
>> array(), array(), array());
>>
>> But that was just a wild guess, after a few hours of trying and trying...
>
> Very wild guess. The ValidationTextBox *view helper* takes for
> arguments, but here you're instantiating a form element. Apples and
> oranges

Okay, i removed it. :)

>> Okay, I already thought it would be possible.
>> But I am still having this error.
>>
>> I posted my code here: http://pastebin.com/m193743a8
>> This is a method which i made inside my contactForm controller. Maybe
>> you could have a look at it?
>>
>> Also, do you know a better way to create this form? I mean, I now had
>> some issues with the submit button. I had to add it separate because
>> it didn't need the <label for="bla"> tag. But that is not the most
>> important thing for now.
>
> Several things I see that could be done differently with that form.
>
> First, just use Zend_Dojo_Form -- it's simpler and easier than using
> Zend_Form and then Dojo-enabling it. It also has the side effect of
> ensuring that the Dojo view helper path is added to the view.

I did this as well.

> Second, use addElement() as a factory instead of passing in concrete
> element instances. This takes advantage of the plugin architecture,
> which will allow you to create your own local overrides of the various
> elements later if you want to.

I modified this too.

> Third, instead of creating the form programmatically within a helper
> method of your controller, instead create your own form class extending
> Zend_Dojo_Form:
>

And this too. I end up with this class:
http://pastebin.com/m5ade6bcf

But I still have the problem that the validation just doesn't work, I
can't find the regex in my sourcecode for example. And the second
problem is, that the <dd> and <dt> tags are back again, despite I
added the decorator function on line 12 which should change them into
<li> tags.

I hope you can help me with this.

Reply via email to