Hide Fields - Multiple
Logic Value 1.7.25.1 Minimal theme
Hide fields based on multiple inputs or multiple selected logic. For this instance selecting only 3 "Offices" will hide extension
HIDE CODE
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | <?php // Get an instance of the Xcrud class $xcrud = Xcrud::get_instance(); // Set the table to work with $xcrud ->table( "employees" ); // Define which columns to display in the table $xcrud ->columns( "lastName,firstName,extension,email,officeCode" ); // Define which fields are available for data entry or editing $xcrud ->fields( "lastName,firstName,extension,email,officeCode" ); $xcrud ->relation( "officeCode" , "offices" , "officeCode" , "city" ); // Hide the 'extension' field when the 'officeCode' IN '7,3,4'(London, NYC, Paris) $xcrud ->hide_logic( "extension" , "officeCode" , "IN" , "7,3,4" ); // Render the xcrud instance to display the table and form echo $xcrud ->render(); ?> |