Hash variable in custom html

Confluence User - 24 Nov, 2020

Hi,

I have two fields on my form. The first one is a select box of users. The second is a read-only, of the email of the selected user from field 1.

How do I automatically fill field 2 with the email when the user is selected?

In my custom html I tried to  use the username from field1 to build a hash variable but it does not work.

This works

alert("#user.john.email#");


But this does not work

var abc = "#user.".concat("john.","email#");

alert(abc);


If this was possible I would just replace "john" with the value of field 1.


forms;hashvariable

2


24 Nov, 2020
confluenceUser
confluenceUser

Maybe you can try using AJAX Subform to show the email address after the user selects the username. Ajax subform will read the changes in your select box and pull the email address to display based on the value of the username. The subform contains one field, which is the email address. Do try out the demo program in this Joget Knowledge Base article.

29 Nov, 2020
confluenceUser
confluenceUser

Hash variable must be parsed at the server side.

Once the page is loaded, any new hash variable inserted (i.e. thru the use of javascript) won't work anymore. As per Matthew's, you can put the hash into ajax subform so that they will be parsed.

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print