Disable select field with JS/JQuery from another/referrer link

jQuery(document).ready(function($){
	$(document).ready(function() {
		// Get the dropdown element
		var dropdown = $('#input_9_18');

		if (document.referrer === 'https://rockymountainpreschool.com/parent-survey/') {
		// Prevent click and selection events
		dropdown.on('mousedown', function(event) {
			event.preventDefault();
		});
		
		// Add the "readonly" attribute to the dropdown
    dropdown.attr('readonly', 'readonly');
			
		// Add the 'custom-cursor' class to the link
    dropdown.addClass('custom-cursor');
		}
	});

});

Leave a Reply

Your email address will not be published. Required fields are marked *