You are not logged in.
This video should help you build your own composite Zend_Form element. We'll be building a phone element. The phone element will have 3 textboxes, one for geographic location, area code and local code. In the following videos will add a custom cell phone validator and some ajax validation.
Grab a copy of the project or browse the repository.
Offline
Hi:
here is my code and how i made a composite form element for the Date Of Birth
the code my not be as good as you might think , but we are all learning something new everyday ![]()
thanks
Offline
Hi Zeherg,
thanks for mentioning this!
Offline
your most welcome ..
i hope that you can make a cast about how to create a composite form element other than text since its ( text elements ) already mentioned in other places.
Offline
hi :
i just want to put a note that you have not to use
$this->htmlin your code instead you will have to use the
$html .
other wise if you have 2 elements it will be rendered as 3 elements since that
$this->htmlwill not be reset for the next element ..
check my code since i have just made the changes ..
http://pastie.org/915510
regards
Offline
Hi Jon,
it looks like, the helper is only instantiated once. So if you use $this->html, to store the generated html-code, and append new html-code, every time a new element is added to the form, the new html-code will be appended to the previous. That is, what zaherg worte a few days before.
And btw: thank you, Jon, for your great zend tutorials!
Oliver
Offline
Hi Oliver, very good point! I missed that when I put together that helper.
Offline