Custom field with data from 2 or 3 other fields

Please help me with this problem.
I create 3 custom field in Item form.
Custom field 1 (type Data) with value „aaaa”
Custom field 2 (type Data) with value „bbbb”
And I want custom field 3 (type Small Text and read only) to have value: „aaaa bbbb”

Custom script as follows:

` cur_frm.cscript.custom_validate = function(doc) {
doc.custom_field3 = doc.custom_field1 + doc.custom_field2

Thanks, works :wink: