Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author doublesharp

    (@doublesharp)

    Hi dkdelosreyes,

    You can – you would just need to convert the values from their string representation to a Datetime or timestamp. For each field the $value variable contains the current field’s value, but you can access the other submitted fields using the $inputs array. Each array element is an array with the keys ‘field’, ‘value’, and ‘prev_value’.

    Thanks!

    Thread Starter dkdelosreyes

    (@dkdelosreyes)

    May I know how could I access the other field values, do you have some code snippets? I’m trying to access another validated field in a repeater field (start_date) to compare to my end_date.

    Thanks!

    Plugin Author doublesharp

    (@doublesharp)

    @dkdelosreyes

    You should be able to do something like:

    for ( $inputs as $input ){
        if ( $input['field'] == 'the field i care about' ){
            if ( $input['value'] != $value ){
                return "the date values don't match";
            }
            break;
        }
    }
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Validation for Date Range?’ is closed to new replies.