Skip to content
This repository has been archived by the owner on Jan 13, 2018. It is now read-only.

Repeater field values aren't appearing in gform_field_validation filter #76

Open
anugupta opened this issue Nov 27, 2016 · 1 comment
Open

Comments

@anugupta
Copy link

Trying to validate a field in the repeater set, using the gform_field_validation filter.

the $values parameter should contain the field values, but instead has this:

{"formId":2,"children":{"8":{"inputs":["input_8"]},"9":{"inputs":["input_9"]},"10":{"inputs":["input_10"]},"11":{"inputs":["input_11"]},"13":{"inputs":["input_13"]}},"repeaterId":"1","repeatCount":2}

Any idea how to get the actual values in there, so I don't need to parse $_POST?

@robfrancken
Copy link

@anugupta Have you tried json_decode?

$data = get_object_vars(json_decode('{"formId":2,"children":{"8":{"inputs":["input_8"]},"9":{"inputs":["input_9"]},"10":{"inputs":["input_10"]},"11":{"inputs":["input_11"]},"13":{"inputs":["input_13"]}},"repeaterId":"1","repeatCount":2}'));

foreach($data['children'] as $child) {
	var_dump($child);
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants