Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Displaying an Error

by httptech (Chaplain)
on Jul 11, 2000 at 06:57 UTC ( [id://21909]=note: print w/replies, xml ) Need Help??


in reply to Displaying an Error

I agree with Russ, don't use a redirect. It is confusing to users, because they won't know what they did wrong.

I usually just take an array of "required" field names and loop through it and any that are blank get added to a scalar that contains an HTML list, like so:

use CGI; my $q = new CGI; my $missed; my @required = qw(name address phone email); for (@required) { $missed .= "<li>$_</li>\n" if $q->param($_) eq ""; } do { print "Content-type: text/html\n\n"; print qq~ You forgot to fill in the following required fields: <ul>$missed</ul> ~; } if $missed;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://21909]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-03-29 14:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found