Convert Text to Clickable URL in Form

Confluence User - 01 Aug, 2017

I'm attempting to add a field to a purchase requisition form that allows the user to save a link to an item they wish to purchase.  As there is no field option for URL, I'm using a text field and then trying to apply custom HTML to convert the value to a link.

  • I have a purchase requisition form, PR_harlingen_request.
  • On this form, the items entered in the PR_items form are listed in the PR_items_grid.
  • There is a sub-form, PR_items, and one can use this form to add multiple items to the request.
  • The sub form has a text field, PR_item_url, where one enters the item link.

I have tried the following:

  1. I added a Custom HTML field to the PR_items form, PR_item_link.
  2. I added the HTML code, <a href="#form.PR_items.PR_item_url#" target="_blank">#form.PR_items.PR_item_url#</a>.
  3. The result was that the text, #form.PR_items.PR_item_url#, was simply turned into a link, and the value of PR_item_url was never populated.  I can understand why this happens initially, as the value has not yet been saved to the database.  However, once I submit the sub-form, then go back into it, the URL still does not reflect the value of PR_item_url.

Next, I tried:

  1. I used the Edit Form Grid screen to edit the PR_items_grid table.
  2. I added a column for PR_item_url, gave it a format type of HTML, and entered in the Format field, <a href="#form.PR_items.PR_item_url#" target="_blank">#form.PR_items.PR_item_url#</a>.
  3. The result was that the value of PR_item_url appeared in the form grid, but it was not a URL.

How can I convert this text into a URL?

Thank you in advance for any assistance.

forms;html;customhtml

1


01 Aug, 2017
confluenceUser
confluenceUser
  1. I added a column for PR_item_url, gave it a format type of HTML, and entered in the Format field, <a href="#form.PR_items.PR_item_url#" target="_blank">#form.PR_items.PR_item_url#</a>.

According to the documentation in Form Grid, the value you keyed in into "Format" is not in use. The cell value itself must return in the form of HTML. By choosing the type "HTML", you are merely telling the form grid not to escape the value to output as plain text.

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print