• Resolved projectmuzzle

    (@projectmuzzle)


    Hello,

    Is there a way to disable the “Enter” button having any effect on the form? I have one field and as the user types in the full query, (ZIP code), the result displays, but if the user presses Enter/ Return, it takes them to a separate “results” page that shows the correct content but this isn’t needed as all of the information we want to display for the search shows up on the first page where the Search field/ form is.

    Is there anyway to disable the users ability to press enter on only this one search field?

    Thanks for your help and any thoughts.

Viewing 1 replies (of 1 total)
  • Hi @projectmuzzle,

    the plugin doesn’t have any option to disable the form submission.

    What you could do though is use the native WordPress search widget which use the form generated by the get_search_form() function.

    This function loads the form present in the searchform.php template. If that template is not present on your theme you can add it manually.

    The template should contain a search form like in these examples.
    To prevent the search form from being submitted you should add an onsubmit attribute to the form element like this:

    <form action="/" method="get" onsubmit="return false;">

    I hope this helps!

Viewing 1 replies (of 1 total)
  • The topic ‘Disable user’s ability to press Enter upon search’ is closed to new replies.