News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

AjaxRay.com:
Extending Zend Form Element to create customized Phone number field
September 02, 2010 @ 08:05:06

On the AjaxRay.com site today there's a new tutorial for the Zend Framework users out there with a library they can use to extend Zend_Form for custom phone number fields.

When taking Phone number as user input, we can worn users about phone number format by setting a hint/description and can validate using Regular Expression. [...] Now, if we try provide this feature in Zend Form, that's possible. We can create three individual Zend_Form_Element_Text objects and join there value together to make the phone number. But, in this case, validating them together is a hassle.

Instead of separate fields, the library they create makes it simple to handle them as a whole field. It works as a helper for Zend_Form and lets you set things like the separator between the text fields, a "format" string and a validator to apply to their fields (in the example code, it's the "digits" validator). Sample code is included to show you how it fits in your form.

0 comments voice your opinion now!
zendform extend phone number custom field tutorial


blog comments powered by Disqus

Similar Posts

Zend Developer Zone: Working with RAR, LZF and BZ2 Compression Formats in PHP

Christoph Dorn's Blog: Profiling queries with Zend_Db_Profiler_Firebug

Daniel Cousineau's Blog: Displaying N-Deep Trees (Remember Your Algorithms Course?)

David Coallier's Blog: Namespaces has PHP 5.3 (Or the other way around)

DeveloperTutorials.com: Writing A Simple Twitter Client Using the PHP Zend Framework's OAuth Library


Community Events











Don't see your event here?
Let us know!


framework unittest opinion release facebook symfony2 hack performance install language hhvm introduction package code security composer overview application component podcast

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework