in reply to How do I make a form field required for a Perl Chat Script?
The generic answer is that there are at least two ways to do what you're attempting. One is to use JavaScript to check that all fields that you require are filled in and not let the page proceed until that requirement is met.
Revolution. Today, 3 O'Clock. Meet behind the monkey bars.
The purely Perl option is to use self referencing CGI, similar to what olus said to do your parsing and not let the script move on until your conditions are met.
$|++; use strict; use CGI; my $query = CGI->new(); print $query->header; if ( !$query->param() ) { # no parameters so display your login page my_login_form(); } else { #since you've got parameters, make sure all that you require are fil +led in and process accordingly.
If your not getting all the fields filled in you want, you just redisplay the login form. If you do get all your fields filled in and verified, then you can proceed.
HTH!
Revolution. Today, 3 O'Clock. Meet behind the monkey bars.
I would love to change the world, but they won't give me the source code
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: How do I make a form field required for a Perl Chat Script?
by Your Mother (Archbishop) on Feb 22, 2008 at 22:40 UTC | |
by Popcorn Dave (Abbot) on Feb 23, 2008 at 01:32 UTC |
In Section
Seekers of Perl Wisdom