JavaScript functions v1.0
Revision as of 15:23, 6 January 2021 by old>Admin (→Toggling fields (version 5478+))
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)
Example
var recordId = getDecimal("SELECTRECORD");
Toggling fields (version 5478+)
Fields can be shown or hidden calling the fieldname
- hideField(fieldName)
- showField(fieldName)
The functions are the equivilant of JQuery
$("#VB_DATA_"+fieldName).parent().parent().hide(); $("#VB_DATA_"+fieldName).parent().parent().hide();
Examples
hideField("USER")
hideField("StatusID")
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)
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.)