From 38370c302429c27ff87189c5518471c674cd96d9 Mon Sep 17 00:00:00 2001 From: Roger C Guilherme Date: Sun, 19 Apr 2026 16:26:15 -0300 Subject: [PATCH] Add clear-field button styles and fix textCounter refs Introduce .btn-limpar-abcd CSS for a compact clear-field button and prevent inputs/textareas in .table-fdt-four from growing wide enough to break button rows. In PHP, unify textCounter calls to use document.forma1 to fix incorrect form references. Update the DOM-inserted clear button: change its class to btn-limpar-abcd and its title to English ('Clear field'). Also remove a stray blank line in the generated output. --- www/htdocs/assets/css/main.css | 34 +++++++++++++++++++ .../central/dataentry/dibujarhojaentrada.php | 9 +++-- 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/www/htdocs/assets/css/main.css b/www/htdocs/assets/css/main.css index da2d3562e..5daa3c3eb 100644 --- a/www/htdocs/assets/css/main.css +++ b/www/htdocs/assets/css/main.css @@ -1985,6 +1985,40 @@ td.no-wrap { margin-bottom: 30px; } +.btn-limpar-abcd { + display: inline-flex; + align-items: center; + justify-content: center; + padding: 2px 6px; + margin-left: 4px; + color: #444; + background-color: #f0f0f0; + border: 1px solid #ccc; + border-radius: 3px; + text-decoration: none !important; + font-size: 0.9em; + cursor: pointer; + vertical-align: middle; + height: 28px; + box-sizing: border-box; +} +.btn-limpar-abcd:hover { + background-color: #e8e8e8; + color: #d9534f; + border-color: #adadad; +} + +textarea+.btn-limpar-abcd { + vertical-align: top; + margin-top: 2px; +} + +/* Ensures that no field is wide enough to break the row of buttons */ +.table-fdt-four input[type="text"], +.table-fdt-four textarea { + max-width: calc(100% - 150px) !important; +} + /* ========================================================================== 8. SPECIFIC STYLES OF PAGES AND COMPONENTS ========================================================================== */ diff --git a/www/htdocs/central/dataentry/dibujarhojaentrada.php b/www/htdocs/central/dataentry/dibujarhojaentrada.php index 34498a870..230ccd366 100755 --- a/www/htdocs/central/dataentry/dibujarhojaentrada.php +++ b/www/htdocs/central/dataentry/dibujarhojaentrada.php @@ -964,8 +964,8 @@ function TextBox($linea, $fondocelda, $titulo, $ver, $len, $tag, $ksc, $rep, $de $campo = $campo; } if ($maxlength > 0) { - echo " onKeyDown=\"textCounter(document.forma$ixforms.tag_" . $tag . ",document.forma$ixforms.rem$tag,$maxlength)\" - onKeyUp=\"textCounter(document.forma1.tag" . $tag . ",document.forma1.rem$tag,$maxlength)\""; + echo " onKeyDown=\"textCounter(document.forma1.tag" . $tag . ", document.forma1.rem$tag, $maxlength)\" + onKeyUp=\"textCounter(document.forma1.tag" . $tag . ", document.forma1.rem$tag, $maxlength)\""; } echo ' onKeyUp="CheckInventory()" >' . $campo . ""; if ($maxlength > 0) @@ -1916,7 +1916,6 @@ function OpenAll(){ require_once("../dataentry/javascript_validation.php"); } ?> -