• Resolved theBlick

    (@theblick)


    Is it possible to validate my Lot Number field with a database of valid lot numbers so only correct entries in this field can be submitted? If so, where can I find the documentation to do it?

    Thank you.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Ralden Souza

    (@rsouzaam)

    Hi @theblick,

    Thanks for reaching out!

    I see the Lot Number field in your form. It seems you’re using our Single Line Text field.

    With WPForms Lite, you can set up form notifications to send out form submission details to your preferred email address.

    Currently, WPForms Lite does not have the feature to store entries, and we’ve provided clarification about this on the Entries page in Lite. However, enabling the Lite Connect option will back-up the entries submitted through your forms. This means that if you decide to upgrade to WPForms Pro, you can restore your entries and have instant access to reports. Please check this guide for more details about this feature.

    If ever you decide to upgrade to the paid version, you’ll be able to restore your entries and store and manage future entries on your site.

    That said, implementing your request would require custom code to validate your Lot Number field, and I apologize as customizations like this fall outside the scope of our support.

    To achieve this, here are two options:

    1. Use the wpforms_process_validate_text action

    This action allows you to validate text fields during form submission. You can refer to our documentation for this hook here. With custom code using this action, you can retrieve the value from your database and validate it during the form submission process.

    2. Leverage the wpforms_field_data filter hook

    This filter allows you to modify field data before it’s rendered. By hooking into this filter, you can fetch the data from your database and apply it as needed to the Lot Number field.

    Here is how the filter can be used:

    add_filter( 'wpforms_field_data', function ( $field, $form_data ) {

    //write their own code here.

    return $field;

    }, 10, 2 );

    In case you’d like to look into custom development options, we highly recommend posting your customization job here.

    I hope this helps! If you’d like more assistance with using WPForms Lite, please feel free to reach out.

    Thanks!

    Thread Starter theBlick

    (@theblick)

    Thank you so much for the information. My follow-up question is can I implement your Option 1 wpforms_process_validate_text with the Basic paid version or does it require one of the higher priced options?

    Thanks.

    Plugin Support Ralden Souza

    (@rsouzaam)

    Hi @theblick,

    Thanks for your follow-up question!

    Since the Single Line Text field is part of our Standard Fields, you can use the wpforms_process_validate_text action with WPForms Lite (our free version) or any paid license, including the Basic license level.

    I hope this helps!

    Plugin Support Ralden Souza

    (@rsouzaam)

    Hi @theblick,

    We haven’t heard back from you in a few days, so I’m going to go ahead and close this thread for now. But if you’d like us to assist further, please feel welcome to continue the conversation.

    Thanks!

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

The topic ‘Validation using database’ is closed to new replies.