Hello everybody,
I am using PhpMaker 12.
I have a table called Kits and it has an ID (Primary key). The field “ID†is not intended to be completed by the user but its value is automatically added to the database using the Sever Event->Table Specific->Add/copy Page->Form_CustomValidate
With the following code
function Form_CustomValidate(&$CustomError)
{
$GLOBALS["Kit]->ID->CurrentValue = time().rand(1,9);
return TRUE;
}
I also set the ID element’s in the client scriptsïƒ table specificïƒ Add/copy pageïƒ Startup Script
document.getElementById('x_ID').style.visibility = "hidden";
The code above works well for Add page as single record. However, when I want to do inline add, grid add, the field “ID†is visible and allows user to input. Also for the inline copy, when I click inline copy or copy, the new record created shows the ID for the original record where it is copied from.
Given the ID value is handled by the Custom validate function, I would like your help on how to
a) Make the ID element in “Inline Add†invisible
b) Make the ID element “Grid Add†invisible
c) Don’t copy the ID value from “Inline Copy or Copy†when creating a new record
Thank you very much for your help
Best,
OA.