Difference between revisions of "JavaScript functions v1.0"
Jump to navigation
Jump to search
old>Admin |
old>Admin |
||
Line 4: | Line 4: | ||
=== Handling form values === | === Handling form values === | ||
Display values are handled using standard getter and setters | Display values are handled using standard getter and setters | ||
* getValue( | * getValue(fieldName) | ||
* setValue( | * setValue(fieldName,value) | ||
Example | |||
var a = getValue("NUMBER1"); | |||
var b = getValue("NUMBER2"); | |||
setValue( "RESULT", (a-b) ); | |||
For explicitly getting a value (or ID) use | For explicitly getting a value (or ID) use | ||
* getDecimal( | * getDecimal(fieldName) | ||
=== Toggling fields === | === Toggling fields === |
Revision as of 15:17, 6 January 2021
Builtin functions
Handling form values
Display values are handled using standard getter and setters
- getValue(fieldName)
- setValue(fieldName,value)
Example
var a = getValue("NUMBER1"); var b = getValue("NUMBER2"); setValue( "RESULT", (a-b) );
For explicitly getting a value (or ID) use
- getDecimal(fieldName)
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 Readonly radiobuttons, copy text in field, build selectbox from service ...
- HACKING DEPENDENT VALUES Handling dependent lookup values (showing all elements etc.)