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.

electronic signature

  1. vivalet
    Member

    I would like to have a single line of input to act as a digital signature. For this, I would like the rule to be that the name in this box needs to match {First Name + " " + Last Name} boxes entered in earlier in the form.

    Is there a way to do this?

    Posted 13 years ago on Friday March 11, 2011 | Permalink
  2. Yes, but it would require you to write custom code. There is a hook you can use to write custom validation for a field. But you would need PHP and WordPress hook/filter usage to implement it OR hire a WordPress developer with customization experience to implement it for you.

    Here is a post that discusses how to do this:

    http://www.gravityhelp.com/forums/topic/data-validation-for-coupon-codes#post-20154

    Posted 13 years ago on Friday March 11, 2011 | Permalink
  3. vivalet
    Member

    I'm not sure I understand this code .. Where is the conditional statement testing whether or not the field value is valid?

    And thank you for your replies as always!

    <?php
    add_filter('gform_validation', 'custom_validation');
    function custom_validation($validation_result){
    
    // set the form validation to false
    $validation_result["is_valid"] = false;
    $form = $validation_result["form"];
    
    // specify the first field to be invalid and provide custom validation message
    $form["fields"][0]["failed_validation"] = true;
    $form["fields"][0]["validation_message"] = "This field is invalid!";
    
    // update the form in the validation result with the form object you modified
    $validation_result["form"] = $form;
    
    return $validation_result;
    
    }
    ?>
    Posted 13 years ago on Tuesday March 15, 2011 | Permalink
  4. That example doesn't have the condition, it only has the pieces of code necessary to start the validation to false and trigger the validation error. The code to validate your field you would have to write yourself. It would then trigger the validation to false if it doesn't meet the requirements of whatever code you put in place. Your code would go just above "Set the form validation to false". That example simply shows how to make a field not validate so it triggers an error. It's just an example of that piece of the functionality.

    Posted 13 years ago on Tuesday March 15, 2011 | Permalink