Form field onClick event

Hello,

How does one capture the onClick event of a particular form field, and then call a function to set the value of another field within the form, please? I can’t seem to find this information in the dhtmlxForm documentation.

Thank you.

I think I figured it out on my own:

dhtmlXForm.prototype.items.input.setClickHandler = function(item){ var inp = item.childNodes[0].childNodes[1].childNodes[0]; inp.onclick = function(){ alert("clicked!"); } }; myForm.doWithItem("myFieldName", "setClickHandler");

Is this correct, please? Thanks.

You can use “onChange” event. This event is called when data in some input was changed

For an input field, it is easy -> you can use onChange, but what should we use for a radio or a checkbox? I was glad to find TouchUI, but there the onChangeEvent for radio and checkbox is also not working.

Olga, thank you for your reply. The ‘onChange’ event is fine if all wants is to know that some change occurred somewhere in the form. The ‘onClick’ event is specific to the form field in question.