in reply to Question about designing a web app using CGI::Application
An alternative I have thought of would be to re-use the same runmode, and check the value of the submit button which would tell me the user submitted the form. So each run mode function would handle displaying the form if the user has not submitted it, otherwise it would process the data.
You need to be careful about using the value of the submit button for tasks like this. In some broswers, pressing the enter key while a form element is active will submit the form, but the value of the submit button is not passed, as it was not physically clicked.
It is better to add a hidden field into the form that you can look for when checking to see if the user submitted a form.
As for your actualy question, I have used both techniques successfuly with CGI::Application, so it is really a matter of personal preference which method you choose to use.
- Cees
|
|---|