How to show/hide fields based on the other list field reference table column which is true or false

Sagar S
Tera Contributor

Hi,

 

We have requirement in which on a form there is a  list collector field called 'policy' referencing to another table. In that reference table there is a 'info required'  field which is a true/false . We need show/hide another field 'MNP info' on a form based on the reference table field 'info required'. Any help on how to achieve this.

 

Regards,

Sagar

14 REPLIES 14

Peter Bodelier
Giga Sage

Hi @Sagar S,

 

You are going to need to use a client script with script include for this.

What have you already tried?


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

@Peter Bodelier 

thank you for your reply, i was about to try that, could you please help me with the code.

 

Regards,

Sagar

Hi @Sagar S,

 

You could use something like this. Script include is not really necessary.

function onLoad() {

var reference= g_form.getReference('<<fieldName>>', getInfo);

function getInfo(reference){
	if(reference.<<fieldName>>== '<<field value>>'){
		g_form.setVisible('<<fieldName>>', false);
	}
}
}

Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

@Peter Bodelier 

Thank you for the reply, i'm using onchange client script since the list collector field reference table field record has false and some has true values. but its not working.