Support

Account

Home Forums Feature Requests Field Group Progress Calculation

Unread

Field Group Progress Calculation

  • Hi,

    I’m attempting to put together a ‘Progress’ identifier for my front-end form field groups. i.e. A field group has 9 fields, if <3 are filled out, the button for the form is red, if <6 then orange, if all 9 are filled then button is green. (This ‘identifier’ will be saved as user_meta, and pulled through as a class attached to the button)

    I have many many Field Groups, which may change over time, so I was hoping to be able to dynamically count how many fields are in a group, see how many have a value and from that deduce a percentage of ‘completeness’.

    As the field group can have conditional fields, I can’t simply count all the fields, as some are unnecessary under conditional rules.

    I can see in the admin-ajax.php request that it seems to only validate against the visible fields by using the acf/validate_save_post action.

    Can I add a filter/action to acf/validate_save_post to count the fields that it tries to validate against? And then do a count against all with !$value?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.