Mitigate duplicate data capture

I added a response in this thread to some of the design proposals included in both threads.

Regarding manually including a redirect link in a form, I think you are on the right path with the anchor. Setting target="_self" as an attribute on the anchor (as you probably know) should make it open the link in the same tab. But, of course, this is not useful for markdown links. And, as you have noticed, our dynamic-url widget only works for markdown links… or does it? :thinking:

It took some tinkering, but I found the proper format to use for your html anchor in a form label to actually be able to trigger the dynamic-url functionality for your custom link!

<a target="_self" href="#" rel="noopener" class="dynamic-url">
    <div class=”url hidden">${link}</div>

With that as your “label text”, it should dynamically load both the link text (from my_name) and the actual link href value (from link). (The dynamic-url/url classes here trigger the dynamic-url widget code to automatically read the link value and set it as the href on the anchor.)

For bonus points, you can re-use the bootstrap classes we already have loaded and update the anchor to have: class="dynamic-url btn btn-primary" style=”display:inline-block;" and you get a very nice looking button! (Though it should be noted that these bootstrap classes are not formally guaranteed to exist in future versions of the CHT. Really all of this is pretty much “use at your own risk”…)

1 Like