Hello
I would like some help there is a hidden field on the form, it should include a generated identifier that can be used to refer to it later here is the code I put in functions.php
function set_formidable_token($values) {
error_log("Function is triggered");
error_log("Form ID from values: " . $values['view_id']);
error_log(print_r($values, true));
if ($values['form_id'] == 2) {
error_log("Form ID condition is met");
$token = generateStrongToken();
$values['item_meta'][135] = $token;
error_log("Token after generation: " . $token);
}
return $values;
I would refer to the ID of the form, which is: 2
and the code of the hidden field on the form is 135 however, it does not enter the cycle unless I enter the ID of "views".
How can I solve this?
The token code is generated, I check this with the error_log
thx Karol
From what formidable hook are you calling this method, i.e., what function is passing "$values" in?
the routine runs automatically before storing the form
That doesn't make sense to me. That function is a custom function, not a formidable one, so either you're explicitly calling it or it's the callback function in one of the hooks.