http://qs1969.pair.com?node_id=610302


in reply to Sticky Forms

You just need to save the value and restore it to your input fields someway.

Where you're actually keeping the data (server-side data against a session, posted form paramters etc... ) would determine the method. Here's a simple example with posted data. Firstname is sticky after the form is submitted, surname isn't.

#!/usr/bin/perl use CGI; use CGI::Carp qw(fatalsToBrowser); use warnings; use strict; my $q = new CGI; my $firstname = $q->param('firstname'); print qq|content-type: text/html\n\n|; print qq|<form action="$ENV{SCRIPT_NAME}" method="post" name=f>\n|; print qq|<input name="firstname" type="text" value="$firstname"/><hr/> +|; print qq|<input name="surname" type="text"/><hr/>|; print qq|<input type="submit" name="form_submit" value="go">|;
---
my name's not Keith, and I'm not reasonable.