Populate second field with the text i enter in first field on same form?

I have 2 fields on form, when I fill data in one field another field should also get populated with that same value. Also this fields are not related to any datasource. Using what methods on field level or datasource level can I use to perform this?

Thanks and regards,

Amit.

Override modified() method on the first control and use appropriate methods for the given type (text(), realValue(), selection()…) to read and set the value. Set AutoDeclaration to Yes on the other control to be able to access it by name from code.

Here is the documentation: Form Controls [AX 2012].