background preloader

CMSs

Facebook Twitter

Zend Framework. Wordpress. Home. ModX. Simple form to email example. Form API Quickstart Guide. Note that these instructions focus on Drupal 6. Corresponding documentation for Drupal 7 is here. The Drupal Form API provides sophisticated form techniques and also allows for almost unlimited possibilities for custom theming, validation, and execution of forms. Even better, ANY form (even those in core) can be altered in almost any way imaginable—elements can be removed, added, and rearranged. Perhaps most important, the Form API provides a secure framework for forms, protecting against many exploits, and the programmer has to do almost nothing to get this protection.

This page is certainly not a comprehensive guide to this functionality. Jump to sections on creating, theming, validating, submitting and understanding the flow. Creating Forms <? Create a submit button: <? A few things to note: The element's name property is declared in the $form array, at the very end of the array tree. Let's take a look at a working piece of code using the API: drupal_get_form does the following: Theming Forms.