• Resolved ojasya

    (@ojasya)


    Hi there,

    Thanks for the awesome plugin.

    We are using the pro plugin but I guess this works the same way so thought of submitting the support request here

    but we need a bit modification for which I didn’t find any kind of setting.

    what we want is if a user type nothing in search box(i.e submit empty string) then search page should not show any result .. or show some custom message that “please type something”

    or is there any JavaScript solution to disable the submit..

    Please help

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author ILLID

    (@mihail-barinov)

    Hello,

    Yes, you can prevent submiting search form if it is empty.
    But in this case you need to make some change in assets/js/common.js file

    In this file find line

    if ( d.showPage ) {

    and replace with

    if ( d.showPage && $searchField.val() !== '' ) {

    Also find

    if ( e.keyCode == 13 && ! d.showPage ) {

    and replace with

    if ( e.keyCode == 13 && ( ! d.showPage || $searchField.val() === '' ) ) {

    Thread Starter ojasya

    (@ojasya)

    thanks a lot for the prompt reply

    Works like charm.

    just one thing

    but what after plugin update

    should I dequeue and enqueue a new common.js

    Plugin Author ILLID

    (@mihail-barinov)

    Yes, you are right.

    After plugin update this changes will be lost.
    You can replace common.js of new plugin version with this one.

    Or maybe I will add in new plugin version some sort of option to enable feature that we add via js code.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘custom message or don’t show any result for empty search string’ is closed to new replies.