Update fields based on other fields programmatically [RESOLVED]

Hi again all,

Working on an add-on. I’m working on a script for it which will be added through the gform_input_change hook, inside a class that extends GF_Field.

What I’m looking for is this:
Field settings contain ID’s of inputs which are to be referenced (eg. ‘2.2’, ‘5’).

When any of these inputs are updated, this will run (example for just one of the fields):

// get the value of the field that's been mapped, the ID will be passed from a PHP variable as a float
var accountNameValue = ???;
const accountNameSpan = jQuery('.ddmwgf-span-name-123');

Any thoughts how I can best retrieve the value of the field? Given that some may have non-conforming IDs/classes, or for a non-AJAX multi-page form may not be visible to be called traditionally, wondering if there’s a GF hook/function I can call that I’m missing…?

I eventually realised that GF passes previous page’s inputs as hidden inputs using the same name/id, so the jQuery method does work after all :slight_smile:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.