diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index 98c5a03c5da..bc79a403002 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -257,8 +257,14 @@ $coldisplay=-1; // We remove first td jQuery(document).ready(function() { - jQuery("#price_ht").keyup(function() { jQuery("#price_ttc").val(''); }); - jQuery("#price_ttc").keyup(function() { jQuery("#price_ht").val(''); }); + jQuery("#price_ht").keyup(function(event) { + // console.log(event.which); // discard event tag and arrows + if (event.which != 9 && (event.which < 37 ||event.which > 40) && jQuery("#price_ht").val() != '') jQuery("#price_ttc").val(''); + }); + jQuery("#price_ttc").keyup(function(event) { + // console.log(event.which); // discard event tag and arrows + if (event.which != 9 && (event.which < 37 || event.which > 40) && jQuery("#price_ttc").val() != '') jQuery("#price_ht").val(''); + }); margin->enabled))