19.10. Creating Sticky Widgets19.10.1. ProblemYou want form fields to default to the last values submitted. For instance, you want a search form like Google (http://www.google.com/) where the keywords you searched for appear in the search dialog above the results. 19.10.2. SolutionUse CGI.pm's HTML shortcuts to create your form, which automatically provides previous values as defaults:
19.10.3. DiscussionExample 19-8 is a simple script for producing the list of users currently logged in. Example 19-8. who.cgi
The call to textfield generates HTML for a text entry field whose parameter name is WHO. After printing the form, we check whether we were called with a value for the WHO parameter. If so, we try to find lines in the output from who for that user. 19.10.4. See AlsoThe documentation for the standard CGI module; Recipe 19.4; Recipe 19.6
Copyright © 2003 O'Reilly & Associates. All rights reserved. |
|