Yes. This can be added to the server side. When creating a form element, add data for the onchange event, as shown below.
$titleElement = $form->createElement('text', 'title', array( 'onchange' => 'alert(this.value);' 'label' => 'This is the title' ));
source share