This lesson is designed specifically for beginner and intermediate Drupal developers. He should quickly give an insight into the basics of Forms API, and also show the possibility of creating more complex things using the example of step-by-step forms.
When I first started preparing this lesson, I was tempted to put a link for downloading a ready-made example under each piece of code, but later, I refused it. It will be much more useful if you yourself insert the code into your modules, testing and gaining experience in real conditions.
And before you begin, I will tell you how to make any of these pieces of code work. Suppose you already have an established test site on Drupal 6. You will have to do the following:
Create a new directory in sites / all / modules , for example my_module
Create the file my_module.info in the directory my_module containing this:
Create file my_module.module . Fully copy the first example from here and paste it into my_module.module .
Enable the module “My module” on the modules page ( admin / build / modules ).
Go to the my_module / form page to run the code.
Next you have to carry out for each example, a complete replacement of the contents of my_module.module with the code of the following example. Do not forget to go to the my_module / form page in order to see the results of your work.