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

142
Vistas
onchange text on javascript woocommerce
<?php
echo'
  <form>
    <input type="text" id="falk_id" name="falk"   value="" maxlength="4"/>
    <input type="text" id="dis_id"  name="coupon" value="" maxlength="4"/>
  </form>
  <script>
    var falakTayebElement = document.getElementById("falk_id");
    var discountElement   = document.getElementById("dis_id");
    var totalPoints       = <?php echo $points;?>;

    falakTayebElement.onchange = function() {
      var points                  = parseInt(falakTayebElement.value);
      var discount                = points / 3 ;
      discountElement.value       = "saasa";
      //discountElement.innerHTML = discount.toFixed(2);
    };

    discountElement.onchange = function() {
      var discount = parseFloat(discountElement.value);
      var points   = discount * 3;
      if(points > totalPoints) {
        falakTayebElement.style.color = "red"; // to show error text
        falakTayebElement.value       = "ليس لديك رصيد كافي من النقاط !"
      } else {
        falakTayebElement.value       = points.toFixed(2);
      }
    }
  </script>';
  }
?>

I don't know what's wrong here, but by changing the element I didn't get any result on the other textfeild. #javascript #php #woocommerce any advice, notes..?

about 4 years ago · Juan Pablo Isaza
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