Categories | Question details Back To List | ||
dhtmlx schdeular & custom field on lightbox, can I move select items text automatically into the text descrition field? I have a custom field on the lightbox corresponding to PROCEDURE similar to below: var procedure=[ {key:180, label:" e. task a 3 HOURS"}, {key:120, label:" f. task b* 2 HOURS"}, {key:120, label:" g. task c* 2 HOURS"}, {key:180, label:" i. task d* ADD 1 hr = 3 HOURS"}, ] What I would like to do is once one of these is selected, to place the text in quotes, or another field on the same line, automatically into the DESCRIPTION text box. Is this possible? Answer posted by Alex (support) on Dec 09, 2009 02:12 You can try to redefine the set_value method of the select: scheduler.form_blocks.select.set_value = function(node,value,ev){ var selectEl = node.firstChild; selectEl.onchange = function(){ var index = selectEl.selectedIndex; txta.value = selectEl.options[index].text; } node.firstChild.value=value||""; } Answer posted by mahesh on Dec 09, 2009 23:27 Alex, Thanks, that does work, although I am also trying to set the length of time automatically as well via using the value associated with a label. Now the text is copied; I lose the setting of the end time. I may just need to consolidate these routines. My script follows if you have a change to look: (function(){ //Add in selected procedure text into description field var txta = document.getElementsByTagName("textarea")[0]; Answer posted by Amit on Dec 10, 2009 00:01 For Setting the Value in TextArea We use,,,.................
var txta = document.getElementsByTagName("textarea")[0];
but if I want to set the value in another Drop down... then i am using,..... var txta = document.getElementsByTagName("select")[8];
but this is not working... can you tell me how i can set value in combo box...
Answer posted on Dec 10, 2009 01:31 Mahesh, >> I lose the setting of the end time There are two definitions of the set_value method of my_select object: scheduler.form_blocks.my_select = { and scheduler.form_blocks.my_select.set_value = function(node,value,ev){ Try to use one. Answer posted by Alex (support) on Dec 10, 2009 01:34 Amit, The txta.innerHTML = "{key: sunday , label: Tomorrow}"; code can't be applied to the select element. In order to set a value you can use the next method: var someSelect = document.getElementsByTagName("select")[8]; |