From f38190d374c83b0aa60f7b5151ac520d38da3404 Mon Sep 17 00:00:00 2001 From: Olivier Auverlot Date: Mon, 4 Mar 2024 07:11:30 +0100 Subject: [PATCH 1/2] A unique identifier for the input, which can then be used to select and manage the field with Javascript code. --- .../sqlpage/migrations/01_documentation.sql | 3 ++- sqlpage/templates/form.handlebars | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/official-site/sqlpage/migrations/01_documentation.sql b/examples/official-site/sqlpage/migrations/01_documentation.sql index a3876da0..5ce9d6b9 100644 --- a/examples/official-site/sqlpage/migrations/01_documentation.sql +++ b/examples/official-site/sqlpage/migrations/01_documentation.sql @@ -237,7 +237,8 @@ INSERT INTO parameter(component, name, description, type, top_level, optional) S ('class', 'A CSS class to apply to the form element.', 'TEXT', FALSE, TRUE), ('prefix_icon','Icon to display on the left side of the input field, on the same line.','ICON',FALSE,TRUE), ('prefix','Text to display on the left side of the input field, on the same line.','TEXT',FALSE,TRUE), - ('suffix','Short text to display after th input, on the same line. Useful to add units or a currency symbol to an input.','TEXT',FALSE,TRUE) + ('suffix','Short text to display after th input, on the same line. Useful to add units or a currency symbol to an input.','TEXT',FALSE,TRUE), + ('id','A unique identifier for the input, which can then be used to select and manage the field with Javascript code. Usefull for advanced using as setting client side event listeners, interactive control of input field (disabled, visibility, read only, e.g.) and AJAX requests.','TEXT',FALSE,TRUE) ) x; INSERT INTO example(component, description, properties) VALUES ( diff --git a/sqlpage/templates/form.handlebars b/sqlpage/templates/form.handlebars index 74db9fd9..db1fcdf5 100644 --- a/sqlpage/templates/form.handlebars +++ b/sqlpage/templates/form.handlebars @@ -16,7 +16,7 @@ {{#if (or (eq type "radio") (eq type "checkbox"))}}