Record date with PHP validation

cropots

New Member
Hello. I have a field called date_time that records when the article was saved, it works well, but in some cases with repeatable fields, the date returns empty, and as the field is hidden, the user will never be able to save the article with the empty field . I'm sure it is possible to record predefined dates or data in the field's php validation, but I don't know how.

Can anybody help me?

I need a way to record the shipping date or any other data I need.

For example:

IF the date_time field is empty, record 2020-09-11 13:30:30 ( Example only, the time would be the current time that the article was recorded )
ELSE keep same date as before

That way I can better control the various fields with fixed data that I will have hidden in the repeatable groups.
 
Last edited:
Hello, as I mentioned in my post, this type of configuration works perfectly, I use it this way for fixed fields. The problem occurs in hidden repeatable fields. I have dozens of bugs with repeatable fields and one of them is to clear the date field when some validation is triggered a few times. The field is hidden and therefore the user cannot save his article unless he updates the page and starts all over again.

I need this date to be recorded IF the date field is cleared for any reason.
 
Oh ok... I thought you just needed a solution for your example.

Well, you know all your groups, elements, validations and conditions. Please check the Wiki links here: you may look at using element JS, or code in a PHP form plugin or form JS to be able to achieve what you need to do -- hard to tell without knowing all details of your environment, but the Wiki articles and some of the examples there might give you pointers and get you on the way.
 
Last edited:
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top