File: formfill.asp

package info (click to toggle)
libapache-asp-perl 2.63-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 4,120 kB
  • sloc: perl: 6,044; php: 409; sh: 62; lisp: 22; makefile: 10
file content (72 lines) | stat: -rwxr-xr-x 1,655 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/perl /usr/bin/asp-perl

<!--#include file=header.inc-->

<%
  $Response->{FormFill} = 1;
%>

<table width=80%><tr><td>

This page makes use of the <b>FormFill</b> feature which
populates a HTML form from $Request->Form data.  The FormFill
functionality is provided by the HTML::FillInForm module,
which in turn relies on HTML::Parser.
<p>
It is enabled with:
  <pre>
  at runtime: $Response->{FormFill} = 1

    -- or --

  in config:  PerlSetVar FormFill 1
  </pre>

At HTML::FillInForm v.07, select boxes must have 
their option values defined explicitly to be auto filled
by the form fill feature, such as:
<pre>
<b><%=$Server->HTMLEncode('<option value="Value">')%></b>
</pre>

<table border=1 cellpadding=5>
<form method=POST>
  <tr><td align=center colspan=2><b>Example Form</b></td></tr>
  <tr>
	<td>Your Name:</td>
	<td><input name=name type=text size=30 value="Your Name"></td>
  </tr>
  <tr>
     <td>Your Favorite Color:</td>
     <td>
         <select name=color>
         <% for my $color (sort('Red', 'Blue', 'Green', 'Yellow')) { %>
 	   <option value="<%=$color%>"><%= $color %></option>
	 <% } %>
         </select>
     </td>
  </tr>
  <tr><td colspan=2><input type=submit value="Submit Info"></td></tr>
</form>
</table>

<% if(%{$Request->{Form}}) { %>

<hr size=1>

  Your name is <tt><%=$Request->Form('name')%></tt> <br>
  Your favorite color is <tt><%= $Request->{Form}{color} %> </tt>
<% } %>

<hr size=1>

The following are the contents of the data returned
from doing a binary read of the form data:
<p>
<tt>
<%=$Request->BinaryRead($Request->{TotalBytes})%>
</tt>

</td></tr></table>

<!--#include file=footer.inc-->