richselect inside a form that passes a text value

Hello. How do I insert a richselect inside a form that passes a text value to another field in the same form? example:
var form = {
view: “form”,
id: “mainView”,
elementsConfig:{

		labelWidth: 130
	},
	scroll: true,
	elements:[
		{view: "text", name: "code", label: "Code"},
		{view: "text", name: "nome", label: "Nome"},
		{view: "text", name: "prezzo", label: "Votes"},
		
		{view: "richselect", name: "categoria", label:"Category", vertical: true, options:
		"data/data_categorie.php",
		on:{onChange: function(id){ 
			 // alert("you have clicked on an item with id="+this.getText());
			  //$$("categoryname").setValue(this.getText());
		  }}
		},
		{view: "text", name: "categoryname", label: "categoryname", value:"44"},
		{view: "text", name: "statusName", label: "statusName"},
		{view:"richselect", name:"status", id:"status", value: 1, label: "Status",  options:[
			{id:"1", value:"Published"},
			{id:"2", value:"Not published"},
			{id:"0", value:"Deleted"}
		],
		on:{
		  'onChange': function(title){ 
			  //alert("you have clicked on an item with id="+$$("status").getText());
			  // $$("statusName").setValue($$("status").getText());
		  }}
		},
			
		//{view: "checkbox", name: "in_stock", label: "In stock",value: 1},
		{ view: "label", label: "Full description", height:30},
		{ id:'editor', name:"descrizione", view:"ckeditor", value:"", editor:{language: 'en'}, minHeight: 220},

		{}
		
	]
};

thanks

onChange: function(){
    var form = this.getFormView();
    form.setValues({categoryname: this.getText()}, true);
OR
    form.elements['categoryname'].setValue(this.getText());
}

Thanks