• Resolved allanit

    (@allanit)


    Hi
    I am working with pods Version 2.5.1.1 and am having a bit of problem. One of the fields in one of the pods I created has to have a value of ‘0’ zero. If the field is a required field I get the following error message when I try to save the information.

    Number is empty

    This happens weather the field is a Plain text field or a Plain Number Field, and the field is required. Any suggestions how to be able to enter a ‘0’ zero in a requited field?

    https://wordpress.org/plugins/pods/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Scott Kingsley Clark

    (@sc0ttkclark)

    Try setting the default value of the field to ‘0’ in the Advanced tab of the field settings.

    And make the field not required. Requiring a number field requires a non-empty value, so there’s no way around that.

    Thread Starter allanit

    (@allanit)

    Hi Scott
    Sorry for my ignorance but how is entering a ‘0’ zero in a field entering an empty value. I would have thought that entering the number ‘0’ zero in a field would be putting something in the field? Can you please explain why the number ‘0’ zero is an empty value.

    Plugin Author Scott Kingsley Clark

    (@sc0ttkclark)

    For the purposes of the require option, it checks if the field has a non-empty value, similarly to how PHP empty works.

    Thread Starter allanit

    (@allanit)

    Hi Scott

    Thanks for the info I did not know that about PHP empty. However that acuses a bit of a problem because what I am trying to save in the field is the PHP numeric value for day of the week and Sundays numeric value is ‘0’ zero.

    Plugin Author Scott Kingsley Clark

    (@sc0ttkclark)

    My suggestion is to use the “N” ISO-8601 format instead of “w” — http://php.net/manual/en/function.date.php

    Plugin Author Scott Kingsley Clark

    (@sc0ttkclark)

    “N” format is 1-7 where “w” format is 0-6

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘‘0’ zero in required field’ is closed to new replies.