Verification Before Form Submission

Home Forums Quform WordPress Verification Before Form Submission

This topic is: resolved
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #16290
    smart367
    Participant

    Hello,

    I want to have the user type in a 4 digit ‘PIN’ (required field) before they submit the form. The PIN must match the PIN I have stored in the user database, basically verifying who they are before accepting the data. So basically I need to compare what they type to ‘user_pin’ in the user db before their request is successfully submitted. Any ideas, it should be easy, wasn’t sure what exactly to search for in the forum.

    #16315
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #16345
    smart367
    Participant

    I have looked at a bunch of examples and I’m pretty sure I’m close but it’s still not giving me what I want.


    function my_pin_validator($valid, $value, $element)
    {
    if (is_user_logged_in()) {
    global $current_user;
    get_currentuserinfo();
    $value = $current_user->user_pin;
    }

    return $value;

    if ($value != user_pin) {
    $element->addError('This PIN does not match our records. Please try again');
    $valid = false;
    }

    return $valid;
    }
    add_filter('iphorm_element_valid_iphorm_5_64', 'my_pin_validator', 10, 3);

    User_pin is in my WP User DB.

    Considering whether the 1st “if” statement is necessary or not, my alternate try at this would be:


    function my_pin_validator($valid, $value, $element)

    if ($value != user_pin) {
    $element->addError('This PIN does not match our records. Please try again');
    $valid = false;
    }

    return $valid;
    }
    add_filter('iphorm_element_valid_iphorm_5_64', 'my_pin_validator', 10, 3);

    Neither works, I am close, I think…

    BTW – are there any developers familiar with Quform available in this forum?
    If I’m out of line asking here, I apologize.

    Scott

    #16351
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #16353
    smart367
    Participant

    Works like a charm, couldn’t have done it without you!

    Thanks a million.

    Scott

    PS – I forgot how to show this solved!

    • This reply was modified 8 years, 9 months ago by smart367.
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy