Hi @sp4448
Thank you for reaching out!
You can use wildcards in your search form. You just need to provide them in the correct format.
Here is a demo:
https://wpdataaccess.com/publication-search-form-demo/
When you enter clara% and press enter, you can see how the wildcard is used. Please note the URL! The % in the URL is encode to %25. If you use a form this should happen automatically. If you do things manually, you need to manually encode as well.
Hope this helps. Feel free to reopen this thread or open a new one.
Have a great weekend,
Peter
Thread Starter
sp4448
(@sp4448)
Thanks Peter. I was hoping there was a way to make a wildcard search the default without the user having to use %.
Hi @sp4448
You can add a default wildcard to the to the value entered by the user. It just requires some javascript code.
Here is a minimal template for one column. You can add additional columns the same way.
<form onsubmit="return submitWithWildcards()"
action="page_containing_your_datatable"
>
<input type="text" id="user_input"/>
<input type="hidden"
id="user_input_with_wildcard"
name="wpda_search_column_your_column_name"
/>
</form>
<script>
function submitWithWildcards() {
jQuery("#user_input_with_wildcard).val(
jQuery("#user_input).val() + "%"
)
return true
}
</script>
I did not test the code! 😇 Just let me know if you need help…
Best wishes,
Peter
Thread Starter
sp4448
(@sp4448)
Thanks! Unfortunately it didn’t work. It brings up the whole table as the result, which is an improvement to bringing up no results, but still not the hoped for result.
Hi @sp4448
Can you share a public URL where we can test the search form and table to see what’s going wrong? Please use the contact form on the plugin website if you prefer to send the information in private.
Thank you,
Peter
Thread Starter
sp4448
(@sp4448)
Thanks! Message sent through contact form.
Hi @sp4448
Sorry, I haven’t seen a message coming in. Are you sure it was delivered? Can you please retry?
Sorry for the inconvenience,
Peter
Thread Starter
sp4448
(@sp4448)
I’ve just sent it again, please let me know if it doesn’t come through.
Hi @sp4448
Sorry, we still got no message. Just to be sure, please use this URL:
https://code-manager.com/contactform/
Or, alternatively, use this one:
https://wpdataaccess.com/contact/
Or send your message to both! 😉
Sorry for the inconvenience,
Peter