• Resolved DTECHNZ

    (@deardevils)


    Min 0, max 100, step 25, even I have no required field, it still shows “This field is required ” if I select 0.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Kaisar Ahmmed

    (@kaisarahmmed)

    Hi @deardevils

    I’m currently looking into this issue and will update you as soon as it’s resolved. Thank you for your patience.

    Thread Starter DTECHNZ

    (@deardevils)

    I made a workaround, but ideally, I hope you can update from the plugin end. Current issue is GF treat 0 as empty. 


    add_filter('gform_field_validation', function ($result, $value, $form, $field) {

      // Only apply to form ID xx

      if ((int)$form['id'] !== xx) {

        return $result;

      }

      $range_slider_field_ids = [1, 2, 3, 4, 5, 6];

      if (in_array((int)$field->id, $range_slider_field_ids, true)) {

        if ($value === '0' || $value === 0) {

          $result['is_valid'] = true;

          $result['message'] = '';

        }

      }

      return $result;

    }, 10, 4);
    Plugin Author Kaisar Ahmmed

    (@kaisarahmmed)

    @deardevils

    Thanks for your solution. I’ll update the plugin as soon as possible.

    Thread Starter DTECHNZ

    (@deardevils)

    Thanks, keep me in the loop.

    BTW, very nice and simple plugin though. Works really well.

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

The topic ‘It cannot save 0 value’ is closed to new replies.