Errors not displaying
5 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: February 4, 2015 (RSS)
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.
Tim (toledoh.com.au)
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
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!
Tim (toledoh.com.au)