OnClick event to populate other form fields?

Hello,

I have created a Dhtmlx form which includes a selection object.

I would like to be able to populate a text field elsewhere on the form when the user clicks one of the selection options.

How do I capture the onClick event for a selection option, please? And how do I then set the value of the text field? Would you be so kind as to provide a code example.

Thank you very much.

Please ignore my previous request. I just attached a BeforeStateChange event to the selection box, followed by a setItemValue method call. Works nicely.

myForm.attachEvent("onBeforeChange", function(name, value, state) { if (myForm.getItemType(name) == "select") { alert("onChange event fired. Value =" + value + " state = " + state); myForm.setItemValue("Title", state); return; } });