The CreatorCon Call for Content is officially open! Get started here.

How to autofill mrvs variable with signleline text

Ak8977
Tera Expert

In the catalog there are Q1 and Q2. Q1 is a yes/no type and Q2 is MRVS. 
 there are 3 variables in the MRVS.
 If I select "yes" in the Q1 then some default text "text123" need to be filled in the 3rd variable in the multi row variable set. Can anyone help me with the script for this.

thanks,

5 REPLIES 5

Ak8977
Tera Expert

I used the following script in the variable set.
it works

function onLoad() {
var temp;
if (this) {
temp = this.cat_g_form.getValue('variable1');
} else {
//Native UI logic
temp = parent.g_form.getValue('variable');
}

if (temp.indexOf('yes') != -1) {
g_form.setVisible("q3", true);
g_form.setMandatory("q3", true);
g_form.setValue("q3", "hello");
}
}