Good Afternoon,
I´m trying to make that when a user select a day in a datepicker calendar, this, autopopulate the day name in an additional text field?
For example if the user select 01/24/2023 in the date field, the text field shoud show Tuesday. From the support send me this code, but I can´t make it work:
add_filter('frm_validate_field_entry', 'copy_my_field', 10, 3);
function copy_my_field($errors, $posted_field, $posted_value){
if ( $posted_field->id == 25 ) { //change 25 to the ID of the hidden field to change
$oDate = $_POST['item_meta'][77]; // change 77 to the ID of your date field $_POST['item_meta'][$posted_field->id] = strtotime($oDate);
}
return $errors;
}
Thank you so much!
Please login or Register to submit your answer