Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Kim L

    (@kimmyx)

    Hi @mikkka,

    Are you using the old table builder or the App Builder?

    Could you send us more information about the things you tried?

    We’ll wait for your response. 🙏

    Thread Starter mikkka

    (@mikkka)

    Hello,
    the old table builder.

    I tried 2 approaches:

    1. By search several order numbers at once
    2. By creating 3 search fields for each order number

    <form action="./orders" method="get">Split the input by commas to get individual order IDs
    <input id="wpda_search_column_order_id" name="wpda_search_column_order_id" type="text" />
    <input class="button" type="submit" /> <input class="button" type="reset" /></form>

    PHP snippet for child theme funcion.php:

    add_action('init', 'handle_custom_search');
    function handle_custom_search() {
    if (isset($_GET['wpda_search_column_order_id'])) {
    $order_ids = $_GET['wpda_search_column_order_id'];

    // Split the input by commas to get individual order IDs
    $order_ids = explode(',', $order_ids);

    // Process each order ID
    foreach ($order_ids as $order_id) {
    // Trim any extra spaces and process the order ID
    $order_id = trim($order_id);
    if (!empty($order_id)) {
    // Example: Log the order ID or perform a search
    error_log("Searching for order ID: $order_id");
    }
    }
    }
    }
    Plugin Contributor Kim L

    (@kimmyx)

    Hi @mikkka,

    Do you have a public link where we can test this form?

    We’ll wait for your response. 🙏

    Thread Starter mikkka

    (@mikkka)

    Hi, no It’s on my wampserver now.

    So you have such a demo search form: https://wpdataaccess.com/publication-search-form-demo/

    Does it work with multiple queries, f. ex. : “Clara, Sara, Mike” for the “First Name” input box? If no what could be a solution?

    Plugin Contributor Kim L

    (@kimmyx)

    Hi @mikkka,

    I’ve reached out to Peter regarding this and he clarified that the search form is a static filter, and does not support multiple queries in a single field.

    This cannot be solved with the available filters, as it needs a different implementation to keep it secure. Each value needs its own bind parameter, and we currently don’t have such an option.

    He’s planning to add this as a possibility to the App Builder, but we don’t have an ETA yet.

    Hope that helps! Let us know if you have other questions. 🙏

    Thread Starter mikkka

    (@mikkka)

    Thank you!

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

The topic ‘Multiple qeries search field in WP Data Access’ is closed to new replies.