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

234
Views
Insert a value changed with js to mysql using angular angular and typescript

Im using js to calculate in real time the cost, but when i click on save, the value on the database is 0 even when the value changed on the input field.

function calculate(){    
    try{ var num1 = parseInt(document.getElementById('a').value) || 0;
    var num2 = 255;
    document.getElementById('price').value = num1 * num2;}
    catch(e){}
}
Heres the HTML code:
  <div class="form-group">
                    <p>Number</p>
                    <input type="number" id ="a" name="persons" [(ngModel)]="reserv.persons" rows="2" class="form-control" oninput="calculate();">
                </div>
<div class="form-group">
                    <p>Price</p>
                    <input name="price" type="number" id="price" [(ngModel)]="reserv.price" oninput="calculate();"  class="form-control">
                </div>

about 4 years ago · Santiago Gelvez
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!