Hi, Three values must add up to 100%. I have used two selects; #Stock_materials and #Stock_WIP with then third #Stock_Finished automatically displaying the result.
Issue is that I want to highlight #Stock_WIP in red with an error message if the total in Stock_WIP is =>100. How do I add it into the below? $(document).ready(function() { $("#Stock_materials, #Stock_WIP").change(function() { $("#Stock_Finished").val(100 - Number($("#Stock_materials").val()) - Number($ ("#Stock_WIP").val()) +"%"); }); });