Menu

Additional fields won't display value in Edit mode

2017-07-10
2017-07-10
  • Campbell Henderson

    I followed this set of instructions to create a few new fields:
    http://forum.orangehrm.com/viewtopic.php?f=6&t=18413&sid=fa8d38e5b5825097a6299ef534636c93

    Everything is working except when in edit mode a couple of fields display their values correctly, the others are blank. The list view displays the correct values, if I enter the values they save / write back to the database correctly, they just don't want to render when the Edit button is clicked.

    These two work perfectly:

    var annual_salary = $(this).closest("tr").find('td.annualsalary').text();
    $("#salary_annual_salary").val(annual_salary);

    var superannuation = $(this).closest("tr").find('td.superannuation').text();
    $("#salary_superannuation").val(superannuation);

    These two do not show the values previously entered when you click Edit on the salary screen:

    var car_allowance = $(this).closest("tr").find('td.car_allowance').text();
    $("#salary_car_allowance").val(car_allowance);

    var other_allowance = $(this).closest("tr").find('td.otherallowance').text();
    $("#salary_other_allowance").val(other_allowance);

    Here is where the LI elements are set earlier in the file.

  • renderLabel(__('Annual Salary')); ?> render(array("class" => "formInputText", "maxlength" => 12)); ?>
  • renderLabel(__('Superannuation')); ?> render(array("class" => "formInputText", "maxlength" => 12)); ?>
  • renderLabel(__('Car or Car Allowance')); ?> render(array("class" => "formInputText", "maxlength" => 12)); ?>
  • renderLabel(__('Other Allowance P.A.')); ?> render(array("class" => "formInputText", "maxlength" => 12)); ?>
  • Any ideas why the first two work and the second two do not?