Errors not displaying

By Toledoh - February 3, 2015

This is driving me crazy.  Can anyone please let me know why no error message is showing when fields are submitted empty?  It should display "You must enter your full name" etc

The message is displaying correct if everything works fine...

I've attached the complete file.

Cheers,

Tim (toledoh.com.au)
Attachments:

_form.php 4K

By claire - February 4, 2015

Hi Tim

Nothing jumps out right now, but have you done a var_dump on the $_REQUEST array just after the form starts to process? You should also do the same to $formErrors after the script passes the error checks.

--------------------

Claire Ryan
interactivetools.com

Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By Toledoh - February 4, 2015

Have I done WHAT to WHO?  LOL.

I'll try that!  Thanks

Cheers,

Tim (toledoh.com.au)

By Toledoh - February 4, 2015

Wow!  Thanks.... I got it!

I added var_dump($formErrors); after the error checking, and it showed them, but for some reason 

else {
$errorsAndAlerts = $formErrors;
}

is not working, so I added. 

<?php if (@$errorsAndAlerts): ?>
<div class="alert"><?php echo $errorsAndAlerts; ?></div>
<?php endif ?>

<?php if (@$formErrors): ?>
<div class="alert"><?php echo $formErrors; ?></div>
<?php endif ?>

Everything sweet!  Thanks!

Cheers,

Tim (toledoh.com.au)