file code.txt validation

Home Forums Quform WordPress file code.txt validation

This topic is: not resolved

This topic contains 1 reply, has 1 voice, and was last updated by  Icemanmx 1 week ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #26292

    Icemanmx
    Participant

    Hello
    I want to make that i can make a code.txt file instead of array of pass codes if that can be done.

    add_filter('quform_element_valid_1_37', function ($valid, $value, $element) {
    $codes = array('PASS', 'pass');

    if (!in_array($value, $codes)) {
    $element->addError('Código no válido');
    $valid = false;
    }

    return $valid;
    }, 10, 3);

    Thanks in advance
    Icemanmx

    #26310

    Icemanmx
    Participant

    Or even can use a api for codes….

    • This reply was modified 1 week ago by  Icemanmx.
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.