# Toggling fields (5478+)

Note: Hide functions are NOT intended for denying access to data -it will only be hidden in the frontend, but is still accessible to savvy users.

Fields can be shown or hidden calling the fieldname

- **hideField(fieldName)**
- **showField(fieldName)**

Examples

```javascript
hideField("USER");
hideField("StatusID");
```

### <span class="mw-headline" id="bkmrk-dependent-toggling-1">Dependent toggling</span>

Hiding and showing fields can be made dependent on classes in the TempusServaPage

- **hideFieldForPageClass(fieldName,className)**
- **showFieldForPageClass(fieldName,className)**

Hiding and showing fields can be made dependent on items current status.

- **hideFieldForStatusId(fieldName,statusId)**
- **showFieldForStatusId(fieldName,statusId)**

Hiding and showing fields can be made dependent on classes in the TempusServaPage AND items current status.

- **hideFieldForPageClassAndStatusId(fieldName,className,statusId)**
- **showFieldForPageClassAndStatusId(fieldName,className,statusId)**

In case of advanced setup consider "hide for all first and show for some later". In this example NAME should only be displayed for a few status

```javascript
hideField("NAME");   
showFieldForStatusId("NAME",1234);
showFieldForStatusId("NAME",1235);
```

### <span class="mw-headline" id="bkmrk-disclaimer-1">Disclaimer</span>

The functions are the equivilant of JQuery

```javascript
$("#VB_DATA_"+fieldName).parent().parent().hide();
$("#VB_DATA_"+fieldName).parent().parent().hide();
```

This means that fields are expected to be wrapped in TWO layers of html tags for the functions to work