document.addEventListener("DOMContentLoaded", function () {

    // Reset button
    document.querySelectorAll('.djev_reset').forEach(function (resetBtn) {
        resetBtn.addEventListener('click', function (e) {
            e.preventDefault();

            var $form = resetBtn.closest('form.djev_search');


            // Text fields
            $form.querySelectorAll('input[type=text]').forEach(function (textField) {
                textField.value = '';
            });

            // Select
            $form.querySelectorAll('select').forEach(function (select) {
                select.selectedIndex = 0;
            });

            $form.submit();
            return false;
        });
    })
});
