Change chart title

Hello,
i have a chart application with two search fields and i want to place the content of the search fields into the chart title. But how can i define a JS onchange function to the search fields?

Best regards and thanks for any help

Siggi