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] = date("m-d-Y", strtotime($oDate)); } return $errors; }
I had to create hidden field on my data input form, and then call the hidden field from my lookup.
The lookup fields are the primary fields used by the clients to book the sessions. So the lookup data being display properly is important. When the user goes to select items from the look up fields they are displayed as indicated above.
Do you have a page for troubleshooting? It might be a thing that is programmatic and needs to look that way. What we can do then maybe is manipulate your design to make the lookup as it is admin only and then add another field for public view that would format it as desired. Just depends on the workflow.
The form is being loaded on this page. You can see what I mean as you go through it.
https://joneswebdesigns.com/dev/new-booking-page/
Thanks Bobby. It’s not the date picker that’s the issue. It’s how a lookup field translate the data entered by the date picker. The date picker is correct, the look up defaults to YY/MM/DD. That’s what I need to change.
That's because of how it's saved to the database from the datepicker field. I expect that if you implement the code above, it will be saved to the database differently and correct your checkbox. Maybe not, but that's how I'm reading it.
Yeah, unfortunately, it didn't make much difference.
The jQuery route would be something like this:
getLabel = jQuery('label[for="chkboxfield"]').find('something').text();
labelsplit = getLabel.split('-');
jQuery('label[for="chkboxfield"]').find('something').text(labelsplit[1] + ' - ' + labelsplit[2] + ' - ' + labelsplit[0]');
It gets more complicated if you want to call the date function and try and pull in month names.
Please login or Register to submit your answer