Event.text default to combo selection

Hi,

I am trying to default the event text to the label of a selection in a combobox.
I am capturing the label and set the event.text, but I can’t seem to find how to refresh the lightbox with the change. It still displays “New event”.

Thanks for the help!

Hi,

Please use locale object https://docs.dhtmlx.com/scheduler/api__scheduler_locale_other.html
to update default value of
scheduler.locale.labels.new_event

Thanks for the reply Polina!

I don’t want to change the label but change the default text field “New event” in the text field manually.

How is that done?

Thanks!

Please add a screenshot to show where you want to do it. Demo also wiil be very helpful to understand the issue http://snippet.dhtmlx.com/8cb7f9024

Thanks for the reply Polina!

snippet

http://snippet.dhtmlx.com/5dcd73296

As I see, course_change() finction doesn’t fire when you create new event
http://snippet.dhtmlx.com/7a3f31b78

You can either use the locale oblect as I mentioned before (but you can’t do it to update text dynamically)
scheduler.locale.labels.new_event = "New description";

or update text of the requred html element manually.

Thanks for the reply, i will try what you suggested.

I figured a way to save the combo selection to a text area. Below is the function I use.

Thanks again for all the help @Polina

		function topic_change(){

			var lstTopics = scheduler.serverList("topic");
			var TopicText = "";

			for(var i=0;  i<lstTopics.length; i++){
				if(scheduler.formSection('Topic').getValue() == lstTopics[i].key){
					TopicText = lstTopics[i].label;
					t=lstTopics.length + 1;
				}
			};		

			scheduler.formSection('description').setValue(TopicText);		
		}