Okay
  Public Ticket #3705259
Filter Format and Validation
Closed

Comments

  • David started the conversation

    Hello,

    I am currently utilizing wpDataTables to search for specific sales representatives based on a single zip code entered. The zip code filter is a text field with exact filtering enabled.

    Could you please advise if there is a method to restrict the zip code filter to accept only five characters, or is there a way to validate that exactly five characters have been entered?

    Thank you for your assistance.

    David

  •  1,846
    Miloš replied

    Hi David,

    Sorry to disappoint you, but at the moment we do not have a way to limit users to only be able to input max character number in a text filter/ or any other filter type.

    And we also don't currently have any data validation feature as built-in options.

    You can suggest it to our developers, though - they will do their best to make a solution in the future.

    Please feel free to search on our suggestions page

     to see if someone may be already suggested this feature. If you can't see it, feel free to add your suggestion there,  and as more people vote, the feature will move higher on the priority list.

    You can certainly follow our changeLog page if you'd like ( it is also available in the plugin dashboard), where we state any changes/new features/bug fixes during updates;

    and our newsletter, so you're informed about new features, bug fixes, freebies, etc.


    If you have coding skills and wish to try to make a custom solution now,

    you can check out our available hooks for Developers on this documentation and see if you can find any hook that might help.

    We also added this new developer's handbook, which can allow users with coding skills to make custom add-ons.

    Our developers will keep adding more custom hooks/examples there over time.


    We can try to provide at least some advice that our developers sent us, and we hope this might help get  you started:

    In this file of our plugin:

    wp-content/plugins/wpdatatables/controllers/wdt_ajax_actions.php 

    around line 252, where the method for saving wdtSaveTableFrontend is, you can find these hooks:

    Actions:

    wpdatatables_before_frontend_edit_row

    wpdatatables_after_frontent_edit_row

    Filters:

    wpdatatables_filter_frontend_formdata

    wpdatatables_filter_formdata_before_save

    wpdatatables_query_before_save_frontend


    With those, a developer can manipulate the data user entered. 

    This is as much as our developers can advise since using combinations and solutions which are not included in the built-in functions of the plugin require additional engagement, and are not included in the provided support.


    It probably can be done with some custom work, but our developers are very busy at the moment, working on some priority tasks and fixing bugs and issues with our plugins, so they won't be having the time for custom work in the near future.


    You can also research resources such as Stack Overflow to see if any other user perhaps found a workaround or alternate ideas.

    I hope it helps.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables