This topic is locked
[SOLVED]

 Disable field in copy page

6/9/2010 2:45:59 AM
PHPRunner General questions
M
marpunta author

Good morning everyone
Here is my little question
I have a table called client and a field called name (and some other fields also)
What i want is when i copy the data the name field to be read only or disabled (so the name can be the same)
BUT when i add new data the name field must be text (so i can add a new name)
THANX

A
ann 6/9/2010

Kostas,
create an alias for the "name" field in the SQL mode on the Edit SQL query tab. Check if the page is Copy page in the Add page: Before Display event on the Events tab. Here is a sample:

if ($_REQUEST["copyid1"])

{$xt->assign("name_fieldblock",false);

$xt->assign("name2_fieldblock",true);}

else

{$xt->assign("name_fieldblock",true);

$xt->assign("name2_fieldblock",false);}
M
marpunta author 6/9/2010

THANX A MILLION
IT WORKS !!!