home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / tsw / TSW_3.4.0.exe / Apache2 / asp / formfill.asp < prev    next >
Encoding:
Text File  |  2003-09-03  |  1.7 KB  |  73 lines

  1. #!/usr/bin/perl /usr/bin/asp-perl
  2.  
  3. <!--#include file=header.inc-->
  4.  
  5. <%
  6.   $Response->{FormFill} = 1;
  7. %>
  8.  
  9. <table width=80%><tr><td>
  10.  
  11. This page makes use of the <b>FormFill</b> feature which
  12. populates a HTML form from $Request->Form data.  The FormFill
  13. functionality is provided by the HTML::FillInForm module,
  14. which in turn relies on HTML::Parser.
  15. <p>
  16. It is enabled with:
  17.   <pre>
  18.   at runtime: $Response->{FormFill} = 1
  19.  
  20.     -- or --
  21.  
  22.   in config:  PerlSetVar FormFill 1
  23.   </pre>
  24.  
  25. At HTML::FillInForm v.07, select boxes must have 
  26. their option values defined explicitly to be auto filled
  27. by the form fill feature, such as:
  28. <pre>
  29. <b><%=$Server->HTMLEncode('<option value="Value">')%></b>
  30. </pre>
  31.  
  32. <table border=1 cellpadding=5>
  33. <form method=POST>
  34.   <tr><td align=center colspan=2><b>Example Form</b></td></tr>
  35.   <tr>
  36.     <td>Your Name:</td>
  37.     <td><input name=name type=text size=30 value="Your Name"></td>
  38.   </tr>
  39.   <tr>
  40.      <td>Your Favorite Color:</td>
  41.      <td>
  42.          <select name=color>
  43.          <% for my $color (sort('Red', 'Blue', 'Green', 'Yellow')) { %>
  44.         <option value="<%=$color%>"><%= $color %></option>
  45.      <% } %>
  46.          </select>
  47.      </td>
  48.   </tr>
  49.   <tr><td colspan=2><input type=submit value="Submit Info"></td></tr>
  50. </form>
  51. </table>
  52.  
  53. <% if(%{$Request->{Form}}) { %>
  54.  
  55. <hr size=1>
  56.  
  57.   Your name is <tt><%=$Request->Form('name')%></tt> <br>
  58.   Your favorite color is <tt><%= $Request->{Form}{color} %> </tt>
  59. <% } %>
  60.  
  61. <hr size=1>
  62.  
  63. The following are the contents of the data returned
  64. from doing a binary read of the form data:
  65. <p>
  66. <tt>
  67. <%=$Request->BinaryRead($Request->{TotalBytes})%>
  68. </tt>
  69.  
  70. </td></tr></table>
  71.  
  72. <!--#include file=footer.inc-->
  73.