Custom Fields
Re-Envisioned
Support General Date fields allow to enter random numbers

  • Creator
    Topic
  • #16059
    Mauro
    Participant

    Hello there,
    We have some date fields in our metabox and just realised it is possible to enter and save random numbers in the field. Is there some built-in way to enable validation and disallow the entry of dates in the wrong format?

    Here’s how we are defining one of the affected date fields.

    Thanks,
    Mauro.

    array (
                    'id' => 'availability_start',
                    'type' => 'date',
                    'format'=>'mm/dd/yy',
                    'name' => 'Available From',
                    'desc' => 'Will be available starting on this date.',
                ),
Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #16090
    Anh Tran
    Keymaster

    Hi Mauro, you can disable the manual entry by setting 'readonly' => true.

    #17004
    Mauro
    Participant

    I had to disable this recently and reset readonly => false because it didn’t show the calendar anymore. Not sure what broke this.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.