I've sent this to this list already once before so I apologize for resubmitting 
this problem.  

This application works fine so long as there are no errors.  If there are validation 
errors what is suppose to happen is the errors are to be displayed at the top of the 
HTML doc followed by the form allowing the user to correct any input errors.

The problem is that the errors are being displayed, then the HTTP header is being 
sent, 
then the actual HTML doc is being sent.  Additionally, the status bar reads 
"Reading file..." for approximately 10 seconds before finally indicating "Document: 
Done".

An example of the output generated follows:

<font color="red"><strong><font size="+1"><u>ERROR(S):</u></font><br>
Application submission failed: Student record exists already
</strong></font>
HTTP/1.1 200 OK
Date: Mon, 29 Nov 1999 19:58:28 GMT
Server: Apache/1.3.6 (Unix) mod_perl/1.21
Content-Length: 4567
Keep-Alive: timeout=15, max=99
Connection: Keep-Alive
Content-Type: text/html

<HTML>
<HEAD><TITLE>Untitled Document</TITLE></HEAD>
<BODY>rest of doc</BODY></HTML>

I've also attached a skeleton copy of the code below.

TIA

Erich

[-
use Apache;
use Apache::Constants qw(REDIRECT);

error checking and form validation going on here...

$new_applicant and $errors are set appropriately here...
-]

<HTML>
<HEAD><TITLE>Untitled Document</TITLE>
</HEAD>
<BODY BGCOLOR="white" TEXTCOLOR="black">
[$ if( ( $new_applicant ) || ( $errors ) ) $]
[+ $application->display_errors_as_html() if( ($errors) || ($application->errors()) ); 
+]
[+ $student->display_errors_as_html() if( $student->errors()); +]

<FORM METHOD="post" ACTION="[+ qq!http://$ENV{SERVER_NAME}/Nactel/new-application.epl! 
+]" ENCTYPE="application/x-www-form-urlencoded">
</FORM>

[$ else $]
[-
use Apache;
use Apache::Constants qw(REDIRECT);

$req_rec->header_out("Location" => 
qq!http://$ENV{SERVER_NAME}/Nactel/common/contact-info.epl?application_id=$fdat{'application_id'}&form_name=$fdat{'form_name'}!);
$req_rec->status(REDIRECT);
-]
[$ endif $]

</BODY>
</HTML>

Reply via email to