Recognising my weaknesses in webdesign, I got someone to convert a form I had created in Excel to a webpage, it was a disaster. I tried fixing it myself with my limited knowledge and plenty of searching to no avail, so I started again but have run into problems with the calculations. If anyone could help me with one I reckon I can do the rest. None of the examples I have found seem to do what I need or am I trying to do the wrong thing?
This is my input with basepay_ being the result from the calculation.
<div class="form-row">
<div class="col-3">
<label for="hours_worked"><p class="font-weight-bold">Enter Hours Worked</p></label>
</div>
<div class="col">
<input type="text" class="form-control" placeholder="Enter Hours Worked">
</div>
<div class="col">
<input type="text" class="form-control">
</div>
</div>
<div class="form-row">
<div class="col-3">
<label for="hourly_rate">Enter Hourly Rate</label>
</div>
<div class="col">
<input type="text" class="form-control" placeholder="Enter Hourly Rate">
</div>
<div class="col basepay_">
<input type="text" class="form-control" placeholder="">
</div>
This is the function.
$(function () {
$("#hourly_rate").keyup(function () {
var hoursworked = $("#hours_worked").val();
//alert(hoursworked);
var hourlyrate = $("#hourly_rate").val();
$("#basepay_").html(hoursworked * hourlyrate);