Forums

Error Handling Messages

wlomax 23 Apr, 2011
When you get an error on your form, you have a red error message appear. I do not want the error message to appear, I want the textbox or text area to change to red. My form is on a page that needs to be a specific height and when the error message appear, they push form elements down and it messes with the look of the page. If the textbox just changed to red, things would be perfect.

Thanks inadvance.
GreyHead 24 Apr, 2011
Hi wlomax,

Which version of ChronoForms are you using? I think that it is CFv3.2 in which case you can add CSS to use the error class that LiveValidation adds to the input:
.LV_invalid_field {
  background-color: red;
}
.LV_validation_message  {
  display :none;
}

Bob
wlomax 24 Apr, 2011
Hi Bob,

I am using Chrono Contact Component 3.1 RC5.5 and plugin V3.1 RC5.2.

I will try your suggestion.

Bill
GreyHead 25 Apr, 2011
Hi Bill,

The same code should work with 3.1 I think.

Bob
wlomax 27 Apr, 2011
Hi Bob,

I have added this code to the section "CSS Styles (May override Chronoforms CSS)" , and it seems to work for what I want. But, what I need now is to get rid of the text " •You have entered an incorrect verification code." when they person submits and highlight the image validation box in red similar to the other sections now.

Thanks
Bill
wlomax 27 Apr, 2011
I could remove the section:

<?php if($MyForm->formerrors){ ?>
<div class="cf_alert">
<ul>
<?php echo $MyForm->formerrors; ?>
</ul>
</div>
<?php } ?>

but, I would still need to get the box for the verification code to turn red.
wlomax 28 Apr, 2011
Hi Bob, in addition to my other problem, I have encountered a new one.

1) I have added some customer server-side code:
<?php
if($_POST['name'] == '' ||
$_POST['phone'] == '' ||
$_POST['email'] == '' ||
$_POST['message'] == '')
return 'Please complete all parts of the form.';
?>


2) When I fill out the form (minus the image validation) and hit submit, the page comes back with the error messages BUT the email field is populated with some JS code e.g.; <script language='JavaScript' type='text/javascript'> <!-- var prefix = 'mailto:'; var suffix = ''; var attribs = ''; var path = 'hr' + 'ef' + '='; var addy1912 = 'dsfdf' + '@'; addy1912 = addy1912 + 'sdfdsf' + '.' + 'com'; document.write( '<a ' + path + '\'' + prefix + addy1912 + suffix + '\'' + attribs + '>' ); document.write( addy1912 ); document.write( '<\/a>' ); //--> </script><script language='JavaScript' type='text/javascript'> <!-- document.write( '<span style=\'display: none;\'>' ); //--> </script>This e-mail address is being protected from spambots. You need JavaScript enabled to view it <script language='JavaScript' type='text/javascript'> <!-- document.write( '</' ); document.write( 'span>' ); //--> </script>

Why is this happening?

Bill
GreyHead 28 Apr, 2011
Hi Bill,

You have the Joomla! Email Cloaking Plug-in enabled and it is trying to cloak the sample e-mail in the ChronoForms validation message. Disable the plug-in temporarily to check this is the problem. If you need the plug-in change the plug-ins order so that Email Cloaking runs before ChronoForms.

NB These are Joomla! plug-ins that you manage from Site Admin | Extensions | Plug-in Manager.

Bob
wlomax 29 Apr, 2011
Thank you, that fixed the JS error, I enabled it and changed the plug-ins order.

Is it all possible to highlight the image validation input field if the user types it in wrong and hits submit. I would rather have that than the error message at the top so it doesn't push the rest of the form down.

You have been very helpful Bob.

Bill
GreyHead 01 May, 2011
Hi Bill,

Hmmm never tried to so that. You can use CSS to hide the message OK - but I'm not sure that there is anything passed that would let you identify the invalid input to re-style that.

Bob
demandingdata 09 Jun, 2011
Hello,
I had the same javascript errors that this poster received.

<script language='JavaScript' type='text/javascript'> <!-- var prefix = 'mailto:'; var suffix = ''; var attribs = ''; var path = 'hr' + 'ef' + '='; var addy29853 = 'dwight.ford' + '@'; addy29853 = addy29853 + 'gmail' + '.' + 'com'; document.write( '<a ' + path + '\'' + prefix + addy29853 + suffix + '\'' + attribs + '>' ); document.write( addy29853 ); document.write( '<\/a>' ); //--> </script><script language='JavaScript' type='text/javascript'> <!-- document.write( '<span style=\'display: none;\'>' ); //--> </script>This e-mail address is being protected from spambots. You need JavaScript enabled to view it <script language='JavaScript' type='text/javascript'> <!-- document.write( '</' ); document.write( 'span>' ); //--> </script>


I followed the suggested track of examining the cloakable plugin. I disabled it and the JS errors disappeared but the form now gives me a blank error - with just the number "1." as if there could be an error text that would show up.

If you care to dig, go to http://www.consciouscreative.com/contact-us and try to enter a form.

Thanks
GreyHead 09 Jun, 2011
Hi demandingdata,

Is this the latest ChronoForms version 3.2?

If so there's a bug in the File upload code. Please see this post.

Bob
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger