Join Jon Peck for an in-depth discussion in this video Creating custom form validation, part of Drupal 7 Custom Module Development.
The Drupal form API provides a mechanism for a number of common validations. …These include required fields, which I've demonstrated, and also includes ensuring that the value …given to a select form element is actually in the domain of available options. …It even provides cross-site request forgery protection without any additional form elements. …With that said, the complexity of the checks don't go much beyond these options and the …error messages are minimal at best. …Fortunately Drupal provides a mechanism for customizing the form validation.…
Before I continue, I will recommend that you would enable the devel module. …Devel is a contributed module that consists of a suite of modules for assisting module …developers with the helper functions and the other debugging information. …I utilize it on a regular basis in my development environment, with a caveat of it should never …be installed in production and care should be taken not to deploy code to production, …with debugging output. …
- Creating your first module
- Interacting with hooks
- Working with permissions and roles
- Controlling access
- Adding a menu item to an admin interface
- Using the Form API (FAPI) to quickly create a form
- Creating custom form validation
- Manually creating a custom content type
- Validating user input
- Importing content using feeds
- Creating a block
- Understanding best practices and coding standards
Skill Level Advanced
Q: gmap3_tools is not working the way I expected it to. What version of gmap3_tools should I be using?
A: Use the free exercise file containing the version of gmap3_tools used for recording; the published version of the module on drupal.org has changed since recording and is not backwards compatible.
Q: I attempted to run the Drupal site root from the project files, but the site isn't loading. Why not?
A: The Drupal configuration file in sites/default/settings.php contains database configuration specific to the environment used to record the movie. This may be different than your environment. Edit the file and search for "windfarms" - you may need to change the database host, username, password, db name and port to match your specific environment.