From aeb04ecfd6fe17583ae6313a153dbd6824423127 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Tue, 18 Oct 2022 16:50:36 +0200 Subject: [PATCH] [Form] Adding Stimulus code --- form/form_collections.rst | 50 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/form/form_collections.rst b/form/form_collections.rst index 6df22f20068..03858d21e15 100644 --- a/form/form_collections.rst +++ b/form/form_collections.rst @@ -238,7 +238,11 @@ it will receive an *unknown* number of tags. Otherwise, you'll see a The ``allow_add`` option also makes a ``prototype`` variable available to you. This "prototype" is a little "template" that contains all the HTML needed to -dynamically create any new "tag" forms with JavaScript. To render the prototype, add +dynamically create any new "tag" forms with JavaScript. + +Let's start with plain JavaScript (Vanilla JS) – if you're using Stimulus, see below. + +To render the prototype, add the following ``data-prototype`` attribute to the existing ``