I have "order" master table with a dropdown field called "Order Type". I have "Test" child table with "Test Code", "Test Name", "Target Gene", "Target Variant" fields.
When user select "Standard Test" option from the dropdown list on order master table then the "Target Gene" and "Target Variant" fields with lebels on Test child form should be hidden but "Test Code"and "Test Name" fields with lebels should be shown.
Similarly when user select "Target Test" option from dropdown list on master table then "Test Code" and "Test Name" fields with lebels on child form should be hidden but "Target Gene" and "Target Variant" fields with lebels on Test child form should be shown.
This can be possible by following the codes as illustrated below from few threads in the forum using Javascript onLoad events for add/edit page. However, those examples applicable for on a single form like either only on master table or on child table. In my case the action should be triggred on child table based on the value on master table.
var ctrDNA = Runner.getControl(pageid,'ordtype');//I want this one on master table
var ctrExtDnaSrc = Runner.getControl(pageid, 'test');// I want this one on child table
$("tr[data-fieldname='test']").hide();
ctrDNA.on('change',function(e){
if(this.getValue()=='stnd'){
$("tr[data-fieldname='test']").show();
}else{
$("tr[data-fieldname='test']").hide();
}
});
Please help with few lines of your code. I appreciate your help.