From 494d4783a7eb77077ed3f56dc43f7658bf9f04ba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2016 18:13:27 +0200 Subject: [PATCH] Fix tab works when editing prices --- htdocs/core/tpl/objectline_edit.tpl.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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))