PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Custom Credit Card Field Validation Message

  1. relish
    Member

    Hi,
    I have enabled the credit card field and would like to be able to customize the validation message on it. I am setting the message and raising the error like on any other field, but the message just doesn't display on the credit card field.

    The field turns red indicating an error, but the message below the Cardholder Name input doesn't appear. The div.gfield_description.validation_message element doesn't appear at all.

    In the gform_validation hook, I am setting the message like this:

    $validation_result["is_valid"] = false;
    $field['failed_validation'] = true;
    $field['errorMessage'] = 'The Credit Card you have entered has been declined.';
    $field['validation_message'] = 'The Credit Card you have entered has been declined.';

    I've even tried setting the $field['content'] element, but there is no change either.

    Can you please let me know how to customize the validation message for the credit card field?

    Thanks for your time!

    EDIT:
    I am using Version 1.6.12

    Posted 6 years ago on Friday May 24, 2013 | Permalink