Make a copy of the modules/Opportunities/metadata/editviewdefs.php to custom/modules/Opportunities/metadata/editviewdefs.php if there is no editviewdefs.php under the custom area.
In your custom/modules/Opportunities/metadata/editviewdefs.php, add the following:
| Code: |
function setField(count)
{
var acc = document.getElementById("account_name").value;
document.getElementById("my_field_c").value = acc+'-'+count;
}
|
And on the field input declaration later in the same editviewdefs.php file, add customCode like
| Code: |
'name' => 'my_field_c',
'customCode' => '<input type="text" name="my_field_c" id="my_field_c" size="30" maxlength="11" value="{$fields.my_field_c.value}" title="" tabindex="113" onblur="setField(0);" />',
'label' => 'LBL_MY_FIELD',
|
So your my_field_c changes with the selected account_name.