Please enable JavaScript to view this site.

Process Designer

Navigation: Javascript API > User dialog functions > Dialog element functions > Data > Write values

jr_set_value(string elementName, mixed value)

Scroll Prev Top Next More

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 and SQLTABLE.

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

Invalid date input