This function sets the value of a dialog element. The function requires JavaScript data elements (e.g. string, number or date elements) as input.
Parameter |
Type |
Description |
|---|---|---|
elementName |
string |
Name of dialog element |
value |
mixed |
Value of dialog element |
Please note: This function does not support the following dialog elements: BUTTON, ALTERNATIFF, ATTACHMENT, BLANK, FILE, SQLTABLE and IMAGE.
Example:
function setDateFieldValue() {
var newDateValue = jr_get_value('end_date');
if (newDateValue instanceof Date) {
jr_set_value('start_date', newDateValue);
}
}
Error handling for date fields:
If a function for a date field is called via an invalid JavaScript date object, e.g. with
jr_set_value('start_date', 'invalid');
an according error message will be displayed:

Invalid date input