admin template change_list.html

Is this possible to add a error msg to search field on listing screen. I want to add a error msg if search field is empty and user clicks on the search button then it has to show error like “search field is empty” etc.

You can use Javascript or Ajax to target the input field and check if it’s value have anything or empty string, then you can show alert box or however you like to render your error message. This will work on client side i.e Front-end (HTML/CSS/JS) but if you want to handle this from server side i.e Back-end (Django) then you have to write your core logic within the view where you are taking the search query params.

This is quite helpful but im a beginner in python so could you please provide me the example.

I had override the django admin change_list.html in my application but in html there is {% block search %} {% search_form cl %} {% endblock %}

So how can i add javascript.

Where you are getting this form from, can you share the code for this one