<< Overview |
Contents
Read/Edit Form Fields$valueAccess to field values: $value// Read Valuevar 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, $setValueRead/Write field values with $getValue, $setValue// Works like $valuevar 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$windowOpen window with text: $windowAllows to open a window showing the text given// Open Window$window("My Message"); $window(sometext); $getFieldGet field object: $getFieldDoes not work with all fields, returns the jQuery-Object// Get jQuery Objectvar field = $getField("age"); // Read/Edit jQuery Field field.val(field.val() + " Years"); Form$showRow, $hideRowShow/Hide lines in form: $showRow, $hideRowAllows to dynamically show or hide contents of the form// Show/Hide Row$showRow("age"); $hideRow("countries"); AdvancedEventsExamples for jQuery EventsUses 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 |