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.

Survey custom validation help

  1. I want to create a form where there will be 4 inputs per page. It will be like 20 pages. I have to make sure that the total number of the entered input values are 10.

    page1
    input1: 2
    input2: 0
    input3: 5
    input4: 3

    page2
    input1
    ……

    in case it is not 10 i should display an error. Is there any smart way to get those 4 inputs for every page and add a custom validation to it?

    Posted 11 years ago on Friday December 14, 2012 | Permalink
  2. In your example here, for page 1, that total is correct and the visitor should be advanced to page 2, correct? But if the total is incorrect, not 10, they should be shown an error?

    You could do this with the gform_validation filter. http://www.gravityhelp.com/documentation/page/Gform_validation
    Check the total of the values entered for those fields, and return an error on that page if the total is not 10.

    You could also do it before the next page is selected, using jQuery. Here is one solution I found for adding up field values http://www.devcurry.com/2010/04/sum-of-all-textbox-values-using-jquery.html

    Posted 11 years ago on Wednesday December 19, 2012 | Permalink