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

114
Views
Assign value of number input to value of radio Button

I have a radio button that when selected reveals a touchspin, anytime the touchspin increase or decrease button is being clicked i want the value of the radio button to be set to the value of the touch spin’s number input. I tried putting ('input.custom-vote:radio').val(value) at the bottom of the increaseValue and decreaseValue function but it still doesn't work. I will greatly appreciate any help to solve this problem.

<!--Touch-spin increase Value-->

function increaseValue() {
  var value = parseInt(document.getElementById('number').value, 10);
  value = isNaN(value) ? 0 : value;
  value++;
  document.getElementById('number').value = value;
}

<!--Touch-spin decrease Value-->

function decreaseValue() {
  var value = parseInt(document.getElementById('number').value, 10);
  value = isNaN(value) ? 0 : value;
  value < 1 ? value = 1 : '';
  value--;
  document.getElementById('number').value = value;
}
<div class="custom-control custom-radio mb-3">
  <input name="votes" value="0" class="form-check-input custom-control-input custom-vote" id="custom" type="radio">
  <label class="custom-control-label form-check-label" for="custom">Custom Vote</label>
</div>

<div class="input-group  custom-vote">
  <button id="decrease" onclick="decreaseValue()" value="Decrease Value" type="button"></button>
  <input type="number" maxlength="6" size="5" class="touchspin form-control custom-count" id="number" value="150">
  <button id="increase" onclick="increaseValue()" value="Increase Value" type="button"></button>
</div>

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

This might work:

document.getElementById("custom").value = document.getElementById('number').value
about 4 years ago · Juan Pablo Isaza Report
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!