Did you use the dffs_fieldChanged function from the Custom JS example thread?
You should be able to do it something like this:
function dffs_fieldChanged(fin, new_value, previous_value) {
switch (fin) {
case "fieldA":
setFieldValue("fieldB", new_value.substring(0, 10)); // 10 first characters of fieldA is written to fieldB
break;
case "fieldC":
setFieldValue("fieldD", new_value.substring(0, 10)); // 10 first characters of fieldA is written to fieldB
break;
}
}
Alexander