First, don't rely on JavaScript alone for form validation. JavaScript validation can be easily bypassed because the server can be accessed directly by bots (and WWW::Mechanize makes the task even easier).
Personally, i would instead use JavaScript as the confirmation page, because you still have to validate what they confirmed! Personally, i think that confirmation pages are only necessary for the deletion of records. But, having said all of that, here is some HTML::Template code that will display a confirmation page -- the trick is using hidden form fields.
use strict; use warnings; use CGI; use HTML::Template; my $q = CGI->new; my $tmpl = HTML::Template->new( filehandle => \*DATA, associate => $q, ); print $q->header, $q->start_html; if ($q->param('cmd') eq 'confirm') { print $q->p("the user confirmed"); } else { print $tmpl->output; } __DATA__ <tmpl_if cmd> You submitted: <ol> <li>foo: <tmpl_var foo></li> <li>bar: <tmpl_var bar></li> </ol> You like? <form> <input type="hidden" name="cmd" value="confirm" /> <input type="submit" value="yes" /> </form> <tmpl_else> <form> foo: <input type="text" name="foo" /><br/> bar: <input type="text" name="bar" /><br/> <input type="hidden" name="cmd" value="ask" /> <input type="submit" /> </form> </tmpl_if>
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to Re: Confirmation page using HTML::Template & CGI::Application
by jeffa
in thread Confirmation page using HTML::Template & CGI::Application
by bar10der
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |