Open Source Web Development with LAMP: Using Linux, Apache, MySQL, Perl, and PHP
by James Lee, Brent Ware
7.8. Form Widget Methods
The here document, though handy, may not be the best way to build every HTML page. CGI.pm provides several other methods to create widgets, including:
start_form()— start tag for the form
textfield()— tag for a text widget
textarea()— tag for a text area
radio_group()— tags for a radio button group
checkbox()— tag for a check box
popup_menu()— tag for a pop-up menu
scrolling_list()— tags for a scrolling list box
submit()— tag for a submit button
reset()— tag for a reset button
end_form()— </FORM>
The following example, /var/www/cgi-bin/widgets3.cgi, uses these methods and produces the same form shown in Figure 7.12. You can find its code at http://localhost/cgi/widgets3.cgi or www.opensourcewebbook.com/cgi/widgets3.cgi ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access