diff --git a/static/js/rooms-list.js b/static/js/rooms-list.js
new file mode 100644
index 0000000..f78b858
--- /dev/null
+++ b/static/js/rooms-list.js
@@ -0,0 +1,26 @@
+// Debounce function
+function debounce(func, wait) {
+ let timeout;
+ return function(...args) {
+ clearTimeout(timeout);
+ timeout = setTimeout(() => func.apply(this, args), wait);
+ };
+}
+
+document.addEventListener('DOMContentLoaded', function() {
+ const searchInput = document.getElementById('roomSearchInput');
+ const form = document.getElementById('roomFilterForm');
+ if (searchInput && form) {
+ searchInput.addEventListener('input', debounce(function() {
+ form.submit();
+ }, 300));
+ }
+ // Clear button logic
+ const clearBtn = document.getElementById('clearRoomsFilter');
+ if (clearBtn && searchInput) {
+ clearBtn.addEventListener('click', function() {
+ searchInput.value = '';
+ form.submit();
+ });
+ }
+});
\ No newline at end of file
diff --git a/templates/rooms/rooms.html b/templates/rooms/rooms.html
index 13f7425..5d1f29c 100644
--- a/templates/rooms/rooms.html
+++ b/templates/rooms/rooms.html
@@ -133,33 +133,6 @@
{% block extra_js %}
-
+
{% endblock %}
{% endblock %}
\ No newline at end of file