Making section of lightbox always hidden

How can I make a certain section of a lightbox form (like the one named “patient_ID”) always hidden?

Here is some of my code:

		{name:"patient_ID", height:20, map_to:"patient_ID", type:"textarea"},
		{name:"description", height:130, map_to:"text", type:"textarea", focus:true},
		{name:"location", height:20, type:"select", map_to:"location", options:[
			{key:"", label:"None"},
			{key:"Area1", label:"Area1"},
			{key:"Area2", label:"Area2"}
		{name:"reason", height:20, type:"select", map_to:"reason", options:scheduler.serverList("reason")},
		{name:"recurring", height:115, type:"recurring", map_to:"rec_type", button:"recurring"},
		{name:"time", height:72, type:"time", map_to:"auto"}

I have been trying to implement this, but it makes ALL sections that use a textarea hidden. I want just to hide certain sections like the section titled “Patient_ID”.

        var style = ev.some_property?"":"none";; // editor area; //section header
        scheduler.setLightboxSize(); //correct size of lightbox

always hidden?
Why do you need a hidden section at all?
Event property will be stored and used for all db operations even if it has not a section in lightbox, so you can just not include property in question in the lightbox at all.

I want to pass a hidden URL value to my db. I am used to doing that with a hidden textbox inside a form.

Not sure if this question was ever answered, but here is the solution I used:

	var sns = this.config.lightbox.sections;	
	for (var i = 0; i < sns.length; i++) {
		if (sns[i].name == "description"){
			node.firstChild.value = "Task";
			var style = "none"; = style; // editor area = style; //section header
			scheduler.setLightboxSize(); //force lightbox auto-sizing

oops… you might want to take the alert line. :smiley:

Nope, it was never answered. Thanks! I’ll try to implement this.

The code I gave before works if you only have one textarea on your form. If you have more than one textarea, you must first edit the dhtmlscheduler.js file.

Find this code:

			var height=(sns.height||"130")+"px";
			return "<div class='dhx_cal_ltext' style='height:"+height+";'><textarea></textarea></div>";

And replace it with this code to add an id to the div that holds the textarea:

			var height=(sns.height||"130")+"px";
			return "<div class='dhx_cal_ltext' id='' style='height:"+height+";'><textarea></textarea></div>";

And then, in your init() function add this code (pay special attention to the highlighted portion):
NOTE: You MUST handle each of your textarea fields in your custom set_value function.

	var sns = scheduler.config.lightbox.sections;
	for (var i=0; i < sns.length; i++) {
		//DESCRIPTION - Field I am hiding
		if(sns[i].name == "description"){
			//editor area
			var thisdescription = document.getElementById("description");
			thisdescription.innerHTML = "<textarea readonly='readonly'>"+ev.itemtype+"</textarea>" || "<textarea readonly='readonly'>Task</textarea>"; = "none";
			//section header
			var thisthisdescriptionheader = document.getElementById(sns[i].id); = "none";
			//force auto-resize of lightbox
		//ITEMCATEGORY - readonly field, and display "better looking" text
		}else if(sns[i].name == "itemcategory"){
			//editor area
			var thisitemcategory = document.getElementById("itemcategory");
			if(ev.itemcategory == "nonspecialty"){
				thisitemcategory.innerHTML = "<textarea readonly='readonly'>Non-Specialty</textarea>";
			}else if(ev.itemcategory == "welding"){
				thisitemcategory.innerHTML = "<textarea readonly='readonly'>Welding</textarea>";
			}else if(ev.itemcategory == "electrical"){
				thisitemcategory.innerHTML = "<textarea readonly='readonly'>Electrical</textarea>";
			}else if(ev.itemcategory == ""){
				thisitemcategory.innerHTML = "<textarea readonly='readonly'></textarea>";
			} = "block";
			//section header
			var thisitemcategoryheader = document.getElementById(sns[i].id); = "block";
		//STDHOURS - not readonly
		}else if(sns[i].name == "stdhours"){
			//editor area
			var thisstdhours = document.getElementById("stdhours");
			thisstdhours.innerHTML = "<textarea>"+ev.stdhours+"</textarea>" || "<textarea></textarea>"; = "block";
			//section header
			var thisstdhoursheader = document.getElementById(sns[i].id); = "block";
		//UNITSTYPE - readonly field
		}else if(sns[i].name == "unitstype"){
			//editor area
			var thisunitstype = document.getElementById("unitstype");
			thisunitstype.innerHTML = "<textarea readonly='readonly'>"+ev.unitstype+"</textarea>" || "<textarea readonly='readonly'></textarea>"; = "block";
			//section header
			var thisunitstypeheader = document.getElementById(sns[i].id); = "block";
		//ITEMQTY - not readonly
		}else if(sns[i].name == "itemqty"){
			//editor area
			var thisitemqty = document.getElementById("itemqty");
			thisitemqty.innerHTML = "<textarea>"+ev.itemqty+"</textarea>" || "<textarea></textarea>"; = "block";
			//section header
			var thisitemqtyheader = document.getElementById(sns[i].id); = "block";
		//ITEMTOTAL - readonly field
		}else if(sns[i].name == "itemtotal"){
			//editor area
			var thisitemtotal = document.getElementById("itemtotal");
			thisitemtotal.innerHTML = "<textarea readonly='readonly'>"+ev.itemtotal+"</textarea>" || "<textarea readonly='readonly'></textarea>"; = "block";
			//section header
			var thisitemtotalheader = document.getElementById(sns[i].id); = "block";

Just FYI… my lisghtbox sections configuration looks like this:

	{name:"description", height:50, map_to:"itemtype", type:"textarea"},
	{name:"itemname", height:21, type:"select", map_to:"itemname", options:[
		$Ctasks = mysql_query("select * from tasks where belongsto != 'milestone' order by belongsto, taskname");
		$counttasks = mysql_num_rows($Ctasks);
		$task = 1;
			if($task == $counttasks){
				echo '{ key:"'.$Rtasks['taskname'].'", label:"'.$Rtasks['belongsto'].' - '.$Rtasks['taskname'].'" }';	
				echo '{ key:"'.$Rtasks['taskname'].'", label:"'.$Rtasks['belongsto'].' - '.$Rtasks['taskname'].'" },';
	{name:"itemcategory", height:25, map_to:"itemcategory", type:"textarea"},
	{name:"stdhours", height:25, map_to:"stdhours", type:"textarea"},
	{name:"unitstype", height:25, map_to:"unitstype", type:"textarea"},
	{name:"itemqty", height:25, map_to:"itemqty", type:"textarea"},
	{name:"itemtotal", height:25, map_to:"itemtotal", type:"textarea"},
	{name:"time", height:72, type:"time", map_to:"auto"}


Shame on us, if the above solution don’t work for you I will create sample with the ‘hidden’ section (though really I believe there is no reason to use it).

Kind regards,

No worries, Ilya. I got it to work in the end.

Thanks for everyone’s help.