/******* Do not edit this file ******* Simple Custom CSS and JS - by Silkypress.com Saved: Jun 05 2025 | 01:14:57 */ jQuery(document).ready(function($) { $('select[name="tipo_producto_servicio"]').on('change', function() { // 1. Selects a limpiar (según formulario) const camposSelect = [ 'forma_hielo_maq_industrial', 'forma_hielo_comercial', 'forma_hielo_barra_industrial', 'forma_hielo_barra_comercial', 'marca_compresor', 'capacidad_torre_enfriamiento', 'produccion_hielo_industrial', 'produccion_hielo_comercial', 'produccion_hielo_barra_industrial', 'produccion_hielo_barra_comercial' ]; camposSelect.forEach(function(campo) { $(`select[name="${campo}"]`).val(''); }); // 2. Campos que deben preservarse const camposPreservar = [ 'nombre', 'apellido_paterno', 'apellido_materno', 'phone', 'city', 'email_from', 'description', // textarea 'honeypot-field' ]; // 3. Limpiar inputs text, tel, email (excepto los preservados) $('input[type="text"], input[type="tel"], input[type="email"]').each(function() { const nombre = $(this).attr('name'); if (nombre && !camposPreservar.includes(nombre)) { $(this).val(''); } }); // 4. Limpiar textarea si no está en preservados $('textarea').each(function() { const nombre = $(this).attr('name'); if (nombre && !camposPreservar.includes(nombre)) { $(this).val(''); } }); // 5. Limpiar honeypot explícitamente $('input[name="honeypot-field"]').val(''); // 6. Ocultar errores de validación de Contact Form 7 $('.wpcf7-not-valid-tip').hide(); }); });