Consider this HTML form from the application which creates a new user: The Dancer2 route that handles it looks as simple as this: Once the form is submitted, HTML:: Form Handler processes the parameters from Dancer2.
When you are asking a reader for their email address, you can use a simple » address validation function to make sure the address has a valid structure. Each option in a drop-down box is indexed in the array Annoyingly, there is no simple way to check which radio button out of a group is selected — you have to check through each element, linked with Boolean AND operators .
A few days ago I pushed to Git Hub a sample web application written in the MVC style with Dancer2 and DBIx:: Class.
In this very first post about it, I'd like to highlight how a route block that processes and validates form data can be made short and neat with the help of HTML:: Form Handler.
When you submit a form to a CGI program that resides on the server, it is usually programmed to do its own check for errors.
If it finds any it sends the page back to the reader who then has to re-enter some data, before submitting again.