Hide Fields - Multiple
Logic Value 1.7.25.1 Bootstrap 5 theme
Hide fields based on multiple inputs or multiple selected logic. For this instance selecting only 3 "Offices" will hide extension
HIDE CODE
<?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(); ?>
Employees
# | Lastname | Firstname | Extension | Officecode | ||
---|---|---|---|---|---|---|
1 | Patterson2 | XXXWilliam | x48711 | xxxwilliam.patterson2@myoffice.com | Boston | View Edit Remove |
2 | Bondur | Gerard | x5408 | gbondur@classicmodelcars.com | Paris | View Edit Remove |
3 | Bow | Anthony | x5428 | abow@classicmodelcars.com | San Francisco | View Edit Remove |
4 | Jennings | Leslie | x3291 | ljennings@classicmodelcars.com | San Francisco | View Edit Remove |
5 | Thompson | Leslie | x4065 | lthompson@classicmodelcars.com | San Francisco | View Edit Remove |
6 | Firrelli | Julie | x2173 | jfirrelli@classicmodelcars.com | Boston | View Edit Remove |
7 | Patterson | Steve | x4334 | spatterson@classicmodelcars.com | Boston | View Edit Remove |
8 | Tsengchu | Foon Yue | o224 | ftseng@classicmodelcars.com | NYC | View Edit Remove |
9 | Vanauf | George | x4102 | gvanauf@classicmodelcars.com | NYC | View Edit Remove |
10 | Bondur | Loui | x6493 | lbondur@classicmodelcars.com | Paris | View Edit Remove |