Julius'Lab

mayo 2023

(Formidable/JavaScript) Hacer que un campo Dinámico dispare otro campo (mientras Lógica Condicional de Formidable no funciona)

En un mundo perfecto, un campo dinámico debería poder «disparar» (trigger) la visualización de otro campo, si la lógica condicional de este campo se pone en:
In a perfect world, a Dynamic field should be able to trigger the displaying of another field, if Conditional Logic of the latter is set like this:

Show this field if any/all of the following match:
Field1 is equal to anything

Pero actualmente no funciona. Formidable alega que está al tanto de este problema, pero aún no tienen fecha de arreglo.
But it currently does not work. Formidable is allegedly aware of this issue, but they don’t have a fix date yet.

Así que, este es mi arreglo (gracias a ChatGPT):
So, this is my fix (thanks to ChatGPT:

<script>
jQuery(document).ready(function($){
// Hide field by default
	$("#frm_field_775_container").css('display','none');

	$(document).on('change', 'select[name="item_meta[773]"]', function(){ //select[name='item_meta[994]']
		var show;

		var val1 = $("select[name='item_meta[773]']").val();
		console.log("Selected value:", val1);
		if (val1 !== '' && val1 !== '0' && val1 !== '-1' && val1 !== ' ')
			{show = true;console.log("showing");}
		else
			{show = false;console.log("hidden");}

		if(show){
			$("#frm_field_775_container").css('display','block');
		}else{
			$("#frm_field_775_container").css('display','none');
		}
	});
});
</script>

Field773 es el campo Dinámico que dispara. Field775 es el campo inicialmente oculto que se muestra al elegir algo en el campo Dinámico.
Field773 is the triggering Dynamic field. Field775 is the field, initially hidden, that shows up when chosing something in the Dynamic field.

(Formidable/JavaScript) Hacer que un campo Dinámico dispare otro campo (mientras Lógica Condicional de Formidable no funciona) Leer más »

(Formidable/Divi) Resolver problema de enlaces de Calendario en Divi

Usando el tema Divi, los enlaces de la vista de Calendario de Formidable no funcionan de manera adecuada. Sólo hacen scroll un poco hacia abajo y no llevan al mes previo o siguiente.

La solución reside en agregar este script en Javascript (usando el plugin Simple Custom CSS and JS):

document.addEventListener('DOMContentLoaded', function() {
  var previousLink = document.querySelector('a.frmcal-prev');
  var nextLink = document.querySelector('a.frmcal-next');
  if (previousLink) {
    previousLink.href = previousLink.href.replace(/#.*/, '');
  }
  if (nextLink) {
    nextLink.href = nextLink.href.replace(/#.*/, '');
  }
});

Este script quita la parte: #frmcal-1411 de los enlaces (1411 en mi caso, es el id de mi vista Calendario), y los transforma de:

https://mysite.com/calendar/?frmcal-year=2023&frmcal-month=04#frmcal-1411

a:

https://mysite.com/calendar/?frmcal-year=2023&frmcal-month=04

Y con eso, el problema se resuelve.

(Formidable/Divi) Resolver problema de enlaces de Calendario en Divi Leer más »