News Feed
Sections




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

Joshua Thijssen:
Dynamic form modification in Symfony2
March 20, 2014 @ 09:42:16

Joshua Thijssen has a new post to his site looking at a way to dynamically modify forms in a Symfony2-based application. Form handling can be a bit tricky (especially with more complex elements), and modifying them on the fly can be even more difficult.

Sometimes (or actually, a lot of the time), handling forms will go beyond the basics. And even though symfony2 gives you out-of-the-box a really clean way of creating forms, it sometimes just isn't enough. Fortunately, you are not alone in writing forms, and many posts exists with information on how to handle complex forms. In this post, I will try and demonstrate how to create a dynamic form where you can select a city based on the chosen province.

His example lets the user pick their province and then populates the other select with cities in that area. He includes the code for the form to create these two selects and how to pull out the list of provinces to populate the first. He goes through each part of the example code explaining the methods, what they're doing and how a pre-submit event can be used to populate the second list.

0 comments voice your opinion now!
dynamic form value modification symfony2 tutorial

Link: https://www.adayinthelifeof.nl/2014/03/19/dynamic-form-modification-in-symfony2

blog comments powered by Disqus

Similar Posts

PHPImpact Blog: Running PHP with Quercus in Jetty Web Server

IBM developerWorks: Use Ajax with PHP and DB2 9 - Xajax

DZone.com: Sencha Touch 2 Models - Loading And Saving Model Data Using a Proxy, PHP Example

PHPMaster.com: Autoloading in PHP and the PSR-0 Standard

Devollo.com: Data Filtering Using PHP's Filter Functions - Part one


Community Events





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


package introduction series library unittest update framework laravel opinion language tips zendserver release install interview podcast api deployment community symfony

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