Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

245
Vistas
Javascript gravity forms, reference field

I need to add a js function into a gravity forms field. I want to take a result from an id=4 field, and add this number as input for a js function, then run the function:

var defaultRate = 1.7;
var halfRate = 1.65;

if (*field id=3* >= *field id=4* /2 ) {
  return halfRate;
} else { 
  return defaultRate;
},

and get the result as an output for my field. How do I refence them? Where do I paste the code? html field or custom js in settings?
I have seen this to use into custom js

<script>
gform.addFilter( 'gform_calculation_formula', function( formula, formulaField, formId, calcObj ) {
    if ( formId == '8' && formulaField.field_id == '13' ) {
        formula += '+5';
    }
    return formula;
} );
</script>
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

This is possible with Gravity Forms Advanced Calculations.

if ( F3 >= F4 ):
    1.65
else:
    1.7
endif;

The F3 and F4 refer to field IDs 3 and 4 respectively. If you find it clarifies the formula further, you could include the full or partial merge tag:

{:3} and {My Field:3}

{:4} and {My Other Field:4}

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda