Focal Point
Calendar icon not hidding when groupbox it is contained in is hidden.

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3791035032

June 01, 2007, 07:45 AM
Chet
Calendar icon not hidding when groupbox it is contained in is hidden.
We have a parameter HTML page created in the HTML Layout Painter that uses Javascript to hide/unhide edit boxes based on a radio button that is selected. One of those groupbox's contains an edit field set as a control type Calendar.

Our problem is that when that groupbox is hidden, the edit field within it hides as well, but the actual calendar icon you click on to bring up the calendar to select from does not hide.

Does anyone know of a way to hide this as well?

We are doing a basic, groupbox3.style.visibility = "hidden";, on the groupbox.

When highlighting the calendar icon on run, it refers to it as edit2_calendar.show(). So naturaly I tried to place a edit2_calendar.hide(), but it returns the error "object doesn't support this property or method".

I also tried edit2_calendar.style.visibility = "hidden" and I get "'edit2_calendar.style' is null or not an object".

Finally, if I try edit2.style.visibility = "hidden", I get the same problem with the field being in the groupbox, the edit box goes away, the calendar icon stays.

Anyone have any ideas?

Thanks,
Chet


WebFocus 7.6.2, MRE through SharePoint, Win XP/2k3.
June 01, 2007, 10:32 AM
Alan B
Chet,

Not quite as simple, but try this in your js:
.
.
//get all images on the page into array
images=document.getElementsByTagName("img");
//get the number of images in array
numImages = images.length;
//Loop through images and see if it is a dynCalendar
for (i=0;i<numImages;++i) {
  if (images[i].src.indexOf("dynCalendar.gif")>0){
//If it is, hide.
   images[i].style.visibility='hidden';
}
}





Alan.
WF 7.705/8.007
June 01, 2007, 02:34 PM
Chet
That worked great. I just set the array value in the for loop to a variable in the page load function and then reused that varaibale to hide/show later. Thank you very much.


WebFocus 7.6.2, MRE through SharePoint, Win XP/2k3.