<<  Overview
Contents
  1. Read/Edit Form Fields
  2. Helper
  3. Form
  4. Advanced

Read/Edit Form Fields

$value

Access to field values: $value

// Read Value
var value = $value(fieldname);

// Set Value
$value(fieldname, newValue);

// Set Value: 'selected' as true/false for selections
$value(fieldname, newValue, selected);
Examples:var value = $value("firstname");

// Set Value age="24"
$value("age", "24");

// Select 'blue', deselect 'green'
$value("colors", "blue", true);
$value("colors", "green", false);

$getValue, $setValue

Read/Write field values with $getValue, $setValue

// Works like $value
var value = $getValue("firstname");

// $setValue: Like $value
// Default: selected=true
// Default: clearOtherSelections=false
$setValue(fieldname, value, selected, clearOtherSelections);
Examples:var countries = $getValue("countries");

// Clear Selection, Add Brasil, Columbia, Venezuela
$setValue("countries", "brasil", true, true);
$setValue("countries", "columbia", true);
$setValue("countries", "venezuela", true);

// Deselect Angola
$setValue("countries", "angola", false, false);

// Clear, Set Status of Image '4_circle_fill.svg'
$setValue("status", "4_circle_fill.svg", true, true);

Helper

$window

Open window with text: $window

Allows to open a window showing the text given// Open Window
$window("My Message");
$window(sometext);

$getField

Get field object: $getField

Does not work with all fields, returns the jQuery-Object// Get jQuery Object
var field = $getField("age");
// Read/Edit jQuery Field
field.val(field.val() + " Years");

Form

$showRow, $hideRow

Show/Hide lines in form: $showRow, $hideRow

Allows to dynamically show or hide contents of the form// Show/Hide Row
$showRow("age");
$hideRow("countries");

Advanced

Events

Examples for jQuery Events

Uses jQuery Events to react to user actions. Works only with fields that are accessible with $getField.var field = $getField("FIELDNAME_HERE");

// Bind Focus Lost Event
field.bind("blur", function () {
    alert("Focus lost, with value: " + field.val());
});
// Bind Change Event
field.bind("change", function () {
    alert("Field edited, with value: " + field.val());
});
Typical Events:
focus: Focus gained
blur: Focus lost
change: Changed
dblclick: Double Click
hover: Mouse overs over field
keyup: Key pressed