<tr>
<td>
Regular Hours:
</td>
<td>
<cfinput type="text" name="regular_hours" id="regular_hours" size="11" maxlength="12" value="#decimalformat(timeSheetInfo.regular_hours)#" />
</td>
</tr>
<tr>
<td>
Overtime Hours:
</td>
<td>
<cfinput type="text" name="ot_hours" id="ot_hours" size="11" maxlength="12" value="#decimalformat(timeSheetInfo.ot_hours)#" />
</td>
</tr>
<tr>
<td>
Total Hours Worked:
</td>
<td>
<cfinput type="text" name="total_hours" id="total_hours" size="11" maxlength="12" value="#decimalformat(timeSheetInfo.Hours_Worked)#" />
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<cfinput type="button" name="EditTimeSubmit" id="EditTimeSubmit" value="Submit Changes">
<div id="EditTimeUpdateComplete"></div>
</td>
</tr>
$('#regular_hours').on('change', function () {
alert('step1');
var val1 = Number(document.getElementById("regular_hours").value);
var val2 = Number(document.getElementById("ot_hours").value);
var val3 = val1 + val2;
document.getElementById("total_hours").value = val3;
});
$('#ot_hours').on('change', function () {
alert('step2');
var val1 = Number(document.getElementById("regular_hours").value);
var val2 = Number(document.getElementById("ot_hours").value);
var val3 = val1 + val2;
document.getElementById("total_hours").value = val3;
});
//$('form[name=TimeSheetDivForm2]').on('click', 'button[name=EditTimeSubmit]', function () {
$('#EditTimeSubmit').on('click', function () {
alert('step3');
$.ajax({
type: 'POST',
url: "cfc/updates.cfc?method=UpdateTimeSheet",
data: "®_profitmarginx=" + $('#reg_profitmargin').val() + "&ot_profitmarginx=" + $('#ot_profitmargin').val() + "®ular_hours=" + $('#regular_hours').val() + "&ot_hours=" + $('#ot_hours').val() + "&payroll_InvoiceNumber=" + $('#payroll_InvoiceNumber').val() + "&week_ending=" + $('#week_ending').val() + "&total_hours=" + $('#total_hours').val() + "&id=" + $('#id').val(),
error: function(xhr, textStatus, errorThrown) {
// show error
alert(errorThrown);
},
success: function(response1, textStatus, jqXHR) {
ColdFusion.Grid.refresh('timeSheetsGrid', true);
ColdFusion.Grid.refresh('timeTotals', true);
//$('#EditTimeUpdateComplete').text('Updated');
return true;
}
});
});
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE