Smart Search validation message not displaying

Dcode warner asked on June 5, 2019 21:44

I have a Smart search webpart on my site. The search works fine, however it doesn't show error message is the field is empty. The "Search Text required" is check under Input validation. But my custom message doesn't show. Leaving the seach box empty and hitting submit just refreshes the page. How can I get my validation message to show.

Correct Answer

Dmitry Bastron answered on June 6, 2019 13:42

Hi,

It works actually but you need some CSS and maybe JS to apply. For example, here is the configuration of the web part:

Image Text

And after clicking on the empty search in the HTML you can see that CSS class and Title fields are actually updating.

Image Text

So what you'd need to do is:

  1. Style input field with some CSS error class
  2. Display Title message

And by the way, to avoid the page reload, you can use Update panel:

Image Text

0 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.