cfalert on server side messages

pcpros2go 07 Jun, 2012
I'm working on a site using Chronoforms 3 and I've got a couple of basic server-side validations.

When I purposely give a wrong answer to the question the server-side validation does pick it up as normal. The result is in the attached image.

That all works fine. But what I'm trying to do is to get that message "Sorry, but you need to answer the math question correctly." into the red box above it.

The code for the box is.
<span class="cf_alert"></span>


I've looked through the files and not finding out where the code is that generates the error messages, so I can modify it and have the error message in that cf_alert box.

I thought it might have been in chronocontact.html.php
<span class="cf_alert"><?php echo '<ol>'.$MyForm->formerrors.'</ol>'; ?></span>


But that didn't work. Any direction would be appreciated.
GreyHead 08 Jun, 2012
Hi pcpros2go,

I'm not sure how you are doing the validation? if you use the SeverSide validation box then the syntax is
<?php
if($_POST['accept_terms'] != 'yes')
  return 'Sorry, but you need to accept our terms to proceed';
?>
and this will automatically set the error message.

If you are doing this and the message is misplaced then it's probably a CSS problem.

Bob
casper99 05 Jan, 2013
The problem appears, when you are using the plugin.
Go to the page (article), where the plugin is being used and see the HTML-Code.
There shouldn't be any <p> Tags around it.
To make sure, that it works, surround your plugin-tags with <div> Tags, and it works.
This topic is locked and no more replies can be posted.