Home › Forums › Quform WordPress › Verification Before Form Submission
- This topic has 4 replies, 2 voices, and was last updated 8 years, 9 months ago by smart367.
- AuthorPosts
- July 20, 2015 at 7:42 pm #16290smart367Participant
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.
July 26, 2015 at 4:56 pm #16315AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
July 27, 2015 at 11:44 pm #16345smart367ParticipantI 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
July 28, 2015 at 11:24 am #16351AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
July 28, 2015 at 2:37 pm #16353 - AuthorPosts
- You must be logged in to reply to this topic.