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 Toledoh - February 4, 2015

Have I done WHAT to WHO?  LOL.

I'll try that!  Thanks

Cheers,

Tim (toledoh.com.au)

By claire - February 4, 2015

:) sorry for the tech speak. Var_dump is a function that puts a variable along with its metadata on the screen, and it's good for figuring out what the page is doing behind the usual HTML/CSS. Let me know if you have issues with it.

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

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

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)