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

110
Vistas
Place JavaScript data in an Input field

The code I have in working, but I cannot figure how to get the value in an input field, right now it works with a <p>.

function myFunction1583(e) {
  var textType = Node.textContent ? 'textContent' : 'innerText',
    hiddenValue1583 = parseFloat(document.getElementById('hiddenValue1583').value) || 0,
    mathValue1583 = parseFloat(document.getElementById('mathValue1583').value) || 0,
    changeValue1583 = document.getElementById('changeValue1583');
  switch (document.getElementById('ValueChange1583').value.replace(/\s/g, '')) {
    case '+':
      changeValue1583[textType] = hiddenValue1583 + mathValue1583;
      break;
    case '*':
      changeValue1583[textType] = hiddenValue1583 * mathValue1583;
      break;
    case 'Manual':
      changeValue1583[textType] = '794.99';
      break;
  }
}
<input type="hidden" id="hiddenValue1583" name="hiddenValue1583" value="20" />
<input type="number" id="mathValue1583" name="mathValue1583" />
<select id="ValueChange1583" value="ValueChange1583" onchange="myFunction1583(event)">
  <option disabled selected>-- Choose --</option>
  <option value="*">Percentage</option>
  <option value="+">Add</option>
  <option value="Manual">Change to</option>
</select>
<p id="changeValue1583" name="changeValue1583">
</p>

I would like the data to fill an input so I can submit the info,

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