#!/usr/local/bin/perl5 asp

<% 
  my %titles = (
		first_name =>	"First Name",
		last_name =>	"Last Name",
		hobby =>	"Hobby"
		);
%>

<!--#include file=header.inc-->
This demo shows the use of ordered collections, so that iterating
over $Request->QueryString() or $Request->Form() returns values
in order that the web browser submitted them.  This tends to be
the order in which they were on the form, but there is no
HTTP standard that requires this, so its more a matter of convenience.

<form src=<%=$demo->{file}%> method=POST>
<table border=0>
<% for('first_name', 'last_name', 'hobby') { %>
	<tr>
		<td><b><%=$titles{$_}%>:</b></td>
		<td><input type=text name="<%=$_%>" value="<%=$Request->Form($_)%>" size=30></td>
	</tr>
<% } %>
<tr><td></td><td><input type=submit value="Submit Data To Order"</td></tr>
</form>
</table>
<% if(my @fields = keys %{$Request->Form()}) { %>
	<hr>
	Ordered output of the $Request->Form() collection:
	<ul><pre><% 
	for(@fields) { 
		%><li><i><%=sprintf("%12s - %-40s\n", $_, $Request->Form($_))%></i><% 
	} 
	%></pre></ul>		
<% } %>
<!--#include file=footer.inc-->

