# Search Behavior When No Query Is Entered

**URL:** <https://forum.bricksbuilder.io/t/search-behavior-when-no-query-is-entered/40453>\
**Category:** How To\
**Created:** [September 29, 2026, 9:59pm UTC](https://forum.bricksbuilder.io/t/search-behavior-when-no-query-is-entered/40453 "2026-09-29T21:59:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![higgin](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/h/a9a28c/32.png) [@higgin](https://forum.bricksbuilder.io/u/higgin)\
**Post date:** [September 29, 2026, 9:59pm UTC](https://forum.bricksbuilder.io/t/search-behavior-when-no-query-is-entered/40453/1 "2026-09-29T21:59:28Z")

</div>

How can we add a short instruction instead of displaying all records when the user presses Enter/Return without entering a query in the search field?

Search element in Bricks Builder v2.4.2

I don’t want to use the Livesearch of Filter-Search.

---

<div class="post-metadata">

**Author:** ![timmse](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/timmse/32/1192_2.png) [@timmse](https://forum.bricksbuilder.io/u/timmse)\
**Post date:** [October 8, 2026, 8:46am UTC](https://forum.bricksbuilder.io/t/search-behavior-when-no-query-is-entered/40453/3 "2026-10-08T08:46:28Z")

</div>

You can make the Search element’s field required, so an empty Enter press stays on the page and prompts the visitor to enter a search term. Add this JavaScript to the page or template’s custom code:

```auto
document.querySelectorAll('.bricks-search-form input[name="s"]').forEach((input) => {
  input.required = true;
});

```

The browser will show its built-in required-field message. This applies to every Bricks Search form on that page and does not require Filter Search.

---

<div class="post-metadata">

**Author:** ![higgin](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/h/a9a28c/32.png) [@higgin](https://forum.bricksbuilder.io/u/higgin)\
**Post date:** [October 8, 2026, 9:08pm UTC](https://forum.bricksbuilder.io/t/search-behavior-when-no-query-is-entered/40453/4 "2026-10-08T21:08:11Z")

</div>

Hi timmese,

Thank you for providing the JavaScript to implement the search query. I’ve implemented the script, and it’s working perfectly!

Really appreciate your quick assistance and the effective solution. Thanks again for your help!
