Home Forums Front-end Issues Validating Group Item


Validating Group Item

  • Hi, I need to validate an item of a group, that when the field is empty it is not displayed, but if the number 0 is placed, it is printed. Currently when you place 0 and only validate it with an if ($ group [‘field’]) it does not print the zero, but if it is valid with if ($ group [‘field’]> = 0) it prints the empty fields.

  • Use explicit value (see if the value is exactly 0) === tests for value and type

    if ($group['field'] || $group['field'] === 0) {
      // show the field
Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Validating Group Item’ is closed to new replies.