document.addEventListener('DOMContentLoaded', function() { // Initialize form validation for contribute page const contributionForm = document.querySelector('form'); if (contributionForm) { contributionForm.addEventListener('submit', function(e) { e.preventDefault(); // In a real app, this would submit to a backend alert('Thank you for your contribution! Our team will review it shortly.'); this.reset(); }); } // Search functionality const searchBtn = document.getElementById('searchBtn'); const searchInput = document.getElementById('searchInput'); const resultsSection = document.getElementById('resultsSection'); const resultsContainer = document.getElementById('resultsContainer'); const popularSection = document.getElementById('popularSection'); searchBtn.addEventListener('click', performSearch); searchInput.addEventListener('keypress', function(e) { if (e.key === 'Enter') { performSearch(); } }); function performSearch() { const query = searchInput.value.trim(); if (query) { // In a real app, this would fetch from an API simulateSearch(query); } } function simulateSearch(query) { // Show loading state resultsContainer.innerHTML = '
Try a different search term
${movie.description}