Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

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?

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-05-22 01:38 GMT
Find Nodes?
    Voting Booth?

    No recent polls found