Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

109
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!