Changes

Show/Hide Header

511 bytes added, 19:36, 10 February 2016
the code supplied does not work, and breaks smartfields spaces removed and semi colon added
{{JavaScript Syntax}}
The '''showhideheader''' function allows you to use one [[Custom Field]] (the '''Control''' field) to show or hide all [[Custom Fields]] that are located under a [[Custom Field Type: Title Bar – Multiple Columns|Title Bar Field]]
* Display the controlled fields when the control field (Custom Field ID 123456) is '''empty''':
onchange="_showhideheader(123456,this.value==''''''')")
==Multiple Title Bars==
'''Multiple headers''' can be hidden/shown simultaneously:
:<font size="3">onchange="_showhideheader(xxxxxx,this.value=='A') ;_showhideheader(yyyyyy,this.value=='B') ;" </font>
This will display the fields under '''Title Bar''' xxxxxx when the control field has value '''A''' and display the fields under '''Title Bar''' yyyyyy when the control field has value '''B'''.
* Use '''this''' instead of '''this.value'''
* ''''Yes;Cancel'''' - values delimited by semi-colon
 
 
'''Example:'''
* Using a select many check box, but allowing only one value to be selected and controlling the showhideheader if the value is '''equal''' to Yes:
onclick="onlyonechecked(this); _showhideheader(123456,this.value=='Yes')"
==Notes==
* The set of fields that you wish to control can be located anywhere on the page. With [[Custom Field Type: Dynamic Data – Dynamic Control Field|Dynamic Control Fields]] the fields must be below the control field.
* Unlike the [[Custom Field Type: Dynamic Data – Dynamic Control Field|Dynamic Control Field]], there are no fields "nested" within the control field.
* The fields hidden by one control can be used to as control fields themselves. Using nested [[Custom Field Type: Dynamic Data – Dynamic Control Field|Dynamic Control Fields]] (dynamic controls within dynamic controls) is not recommended, and you cannot report below the first level of nested fields.* If using '''[[Allowing Only One Check Box to be Selected|onlyonechecked]]''' on a [[Custom Field Type: Select Many – Check Boxes|Select Many - Check Box]] field and you also want to Show/Hide Header you should use '''_showhideheader''' instead of '''_showhideheadercheckbox'''
==See Also==
Visibility of [[Custom Fields]] can also be controlled using:* [[Role Field PermissionsMaking a field under a show/hide header mandatory]] * [[Status Field PermissionsConditional Lists of Values]]* [[Visibility Condition]]{{VisibilityofCustomFields}}
[[Category:Custom Fields]][[Category:JavaScript]]
Smartstaff, administrator
3,321
edits