This topic is locked
[SOLVED]

 javascript to dynamically hide links

8/5/2010 1:37:16 PM
PHPRunner General questions
P
PAGD author

I wonder if anyone can help with the following problem.
I have a Master table with several Detail tables. I want to be able to chose which of these Detail tables are linked to the Master depending on a field in the Master table.
I think I need to use javascript on the Javascript OnLoad event, by hiding the non required links, but I'm not sure how to do this.
Can anyone hep?

A
ann 8/6/2010

Hi,
you can hide link to the child tables on the master table list page in the After record processed event on the Events tab.

Here is a sample:

if ($data["FieldName"]==1) {

$record["childtable_dtable_link"]=false;

$record["childtable2_dtable_link"]=true;

}

else {

$record["childtable_dtable_link"]=true;

$record["childtable2_dtable_link"]=false;

}



where FieldName is your actual field name, childtable, childtable2 are your child table names.

P
PAGD author 8/6/2010



Hi,
you can hide link to the child tables on the master table list page in the After record processed event on the Events tab.

Here is a sample:

if ($data["FieldName"]==1) {

$record["childtable_dtable_link"]=false;

$record["childtable2_dtable_link"]=true;

}

else {

$record["childtable_dtable_link"]=true;

$record["childtable2_dtable_link"]=false;

}



where FieldName is your actual field name, childtable, childtable2 are your child table names.



Thanks Ann it works fine!