I'm wondering if it is possible to add a link to a field within a contour form? For instance: I have added a checkbox to accept terms and conditions, and would like to make the text a hyperlink to the terms and conditions page.
You can do this by using a dictionary item as a label for the field. You can create a dictionary item with html content and use #dictionaryitemalias (with dictionaryitemalias being the name of the dictionaryitem) as the content of the label
I know it's pretty wild to bump a post with the last reply from 6 years ago (original post from 10!! years ago) but this is the one that popped up for me on Google.
On Umbraco forms 7 you can just drop the HTML into the body text of a Title and Description component on a form, for example:
Lorem ipsum bacon <a href="https://google.com" target="_blank">Click here to go to google</a> lorem ipsum bacon.
Inserting Links Into A Form
I'm wondering if it is possible to add a link to a field within a contour form? For instance: I have added a checkbox to accept terms and conditions, and would like to make the text a hyperlink to the terms and conditions page.
I would like to do this too but any HTML seems to be escaped, e.g.
Hello,
You can do this by using a dictionary item as a label for the field. You can create a dictionary item with html content and use #dictionaryitemalias (with dictionaryitemalias being the name of the dictionaryitem) as the content of the label
That did the trick. Good solution!
In the new version of Contour 3.0.6 links created using dictionary items are being escaped so not rendering correctly.
This is using Razor. The answer is:
Comment author was deleted
Thanks for reporting will added to issue tracker and will be updated in next maintenance release
I'm using 3.0.12 and have noticed that using #dictionaryterm doesn't seem to work - the # is stripped from the field caption when rendering the form
e.g. #terms
is displayed as
terms
I'd suggest you upgrade. U3 is VERY old.
sorry, I mean Contour 3.0.12 (Umbraco 6.0.5)!
Comment author was deleted
And did you populate the terms dictionary item? Language set on the node structure containing the form?
Ok, was getting ahead of myself - i was previewing the form, where it doesn't display.
On the page itself, the dictionary term is displayed, although the html is escaped as mentioned above.
Comment author was deleted
What version are you running?
Contour 3.0.12 (Umbraco 6.0.5)
Adding @Html.Raw(@f.Caption) to form.cshtml fixes it, i just thought that CON-242 had fixed it already.
Comment author was deleted
Yeah looks like it got removed accidently (due to a merge)
I know it's pretty wild to bump a post with the last reply from 6 years ago (original post from 10!! years ago) but this is the one that popped up for me on Google.
On Umbraco forms 7 you can just drop the HTML into the body text of a Title and Description component on a form, for example:
Then that link is rendered properly on the form!
In computer years that's about 1000 years after the question was posed!
is working on a reply...