By Alvin Alexander. Last updated: June 4, 2016
This page serves as an index to all of my Drupal module, form, and databases tutorials and examples. In an effort to help supplement the documentation on the Drupal.org website, over time I hope to have good examples for every Drupal module and form problem you'll run into.
Drupal form examples
- A simple Drupal form example ("My first Drupal form")
- A Drupal form 'submit button' and submit handler function example
- A Drupal form 'weight' field example
Drupal forms - textfield and textarea examples
- A Drupal form textfield example
- A Drupal form textarea example
- Drupal form textfield required syntax
- Drupal form field 'required' syntax
- Drupal form textfield help text (description) syntax
- Drupal form textfield 'default value' syntax
Drupal form password fields
Drupal form checkboxes, radios, dropdown lists (select/option), date, hidden
- A Drupal form radio buttons example (Drupal radios field)
- A Drupal form checkboxes example (HTML check boxes)
- A Drupal date field form example
- A Drupal form hidden field example
- A Drupal form select/options field example (dropdown box)
Drupal form table examples
- A Drupal theme table example
- Create a Drupal table list view from a Drupal module
- A Drupal 7 form table with a pager
- A Drupal 7 table with sortable column headers, a pager, and 'edit' hyperlinks in each row
Drupal form fieldset examples
- A Drupal fieldset example (Drupal form group)
- The Drupal fieldset collapsible syntax
- The Drupal fieldset initially collapsed syntax
Drupal database examples
- Drupal 7 SQL cheat sheet
- A Drupal 7 db_insert query (SQL INSERT statement)
- A Drupal 7 db_delete example (SQL DELETE query)
- Drupal 6 SQL insert examples (and syntax)
Drupal form CSS and HTML markup
Drupal forms and modules - Miscellaneous
Drupal.org form links
- Drupal API docs
- Drupal theming docs
- Drupal hooks
- Drupal form generation
- My Drupal help page (many more Drupal.org links)
Related Drupal and PHP tutorials
The following tutorials and examples are also related to Drupal form and module programming:
Drupal form and module examples - Summary
I hope you'll find these Drupal form and module examples helpful. While I'm still in the early stages of my Drupal form and module programming career, I at least have a good feel for the documentation and examples I need, so I'm hoping these will be helpful to you as well.