Thanks that makes more sense although I'll need to loop through the repeatable sections which I haven't done before. I'll look into that presumably a foreach?
It's not the most complicated thing ever, however, it's not as easy as you'd hope. I'm on the verge of writing a tutorial on how to extract repeater information. I hope to have it done this week.
I think it can wait and I'll be your guinea pig if you want
Thanks again, I shall try that and let you know.
Thanks Victor, still not working for me though
add_filter('frm_validate_field_entry', 'copy_my_field', 10, 3);
function copy_my_field($errors, $posted_field, $posted_value){
if ( $posted_field->id == 50 ) {
$new_designation = $posted_value;
$new_base = $_POST['item_meta'][53];
FrmEntry::create(array(
'form_id' => 8,
'item_key' => 'entry',
'frm_user_id' => $user,
'item_meta' => array(
164 => $user,
30 => $new_designation,
57 => $new_base
),
));
}
return $errors;
}
The new_designation is being created but the base cost is not and neither is the user ID. You're 100% right though I've printed the array and can see everything I need, array within an array for each of the repeatables but I'm getting closer/
I need to work on only running it when a new designation is added so it runs even when the field is blank.
Please login or Register to submit your answer