Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

111
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda