Textfield with customisable name

I would like to have a field which stores a “Custom Code” Is there a way to store this code in one field and name which this code corresponds to in seperate fields of the database but in the same field in the edit view.

I have attached an example of this:

I managed to solve this by creating two fields and then using the following in editviewdefs.php.

          array (
            'name' => 'custom_field_1_c',
            'label' => 'LBL_CUSTOM_FIELD_1',
            'customCode' => '<input type=\'text\' name=\'custom_field_1_name_c\' id=\'custom_field_1_name_c\' size=\'30\' value=\'{$fields.custom_field_1_name_c.value}\' maxlength=\'26\' title=\'\' tabindex=\'0\'/>
			<input type=\'text\' name=\'custom_field_1_c\' id=\'custom_field_1_c\' size=\'20\' value=\'{$fields.custom_field_1_c.value}\' maxlength=\'26\' title=\'\' tabindex=\'0\'/>',

Hopefully this helps someone if they are doing something similar.