Difference between revisions of "JavaScript functions v1.0"

From TempusServa wiki
Jump to navigation Jump to search
old>Admin
old>Admin
Line 12: Line 12:
=== Toggling fields ===
=== Toggling fields ===
Fields can be  shown or hidden calling the fieldname
Fields can be  shown or hidden calling the fieldname
* hideField(name)
* hideField(fieldName)
* showField(name)
* showField(fieldName)


Examples
Examples
Line 22: Line 22:


Hiding and showing fields can be made dependent on classes in the TempusServaPage and/or items current status.
Hiding and showing fields can be made dependent on classes in the TempusServaPage and/or items current status.
* hideFieldForPageClass(name)
* hideFieldForPageClass(fieldName)
* showFieldForPageClass(name)
* showFieldForPageClass(fieldName)
* hideFieldForStatusId(name)
* hideFieldForStatusId(fieldName)
* showFieldForStatusId(name)
* showFieldForStatusId(fieldName)
* hideFieldForPageClassAndStatusId(fieldName,className,statusId)
* hideFieldForPageClassAndStatusId(fieldName,className,statusId)
*showFieldForPageClassAndStatusId(fieldName,className,statusId)
*showFieldForPageClassAndStatusId(fieldName,className,statusId)

Revision as of 16:13, 6 January 2021

Builtin functions

Handling form values

Display values are handled using standard getter and setters

  • getValue(name)
  • setValue(name,value)

For explicitly getting a value (or ID) use

  • getDecimal(name)

Toggling fields

Fields can be shown or hidden calling the fieldname

  • hideField(fieldName)
  • showField(fieldName)

Examples

  hideField("USER")
  hideField("StatusID")

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

  • hideFieldForPageClass(fieldName)
  • showFieldForPageClass(fieldName)
  • hideFieldForStatusId(fieldName)
  • showFieldForStatusId(fieldName)
  • hideFieldForPageClassAndStatusId(fieldName,className,statusId)
  • showFieldForPageClassAndStatusId(fieldName,className,statusId)

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

Other sources

JQUERY / SCRIPT CHEATSHEET HACKING DEPENDENT VALUES