Focal Point
Show/Hide Calendar control

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

May 07, 2008, 07:29 AM
<B_B>
Show/Hide Calendar control
Hi,
I need to show/Hide a calendar control completely. Everytime i trying doing that only the text box show/hides. But, the image does not hide.
Is there any suggestion on how to hide the image as well.
Thanks.
May 07, 2008, 08:14 AM
Leah
Inquiring minds would like to know why? If you don't want the control used, just have the 'date' entered in the format needed in a text box and forget the calendar.


Leah
May 07, 2008, 08:37 AM
Tony A
The calendar control is a separate control from the text input control and if you want both to be hidden then I would suggest something along the lines of enclosing them both within a DIV tag. Then to hide / show them just change the display to block or none accordingly.

Remember that painter (generally, 5.3.x to 7.1.6 at least) places the text for the control within a SPAN tag so you'll need to encompass that as well.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
May 08, 2008, 01:29 AM
<B_B>
Hi Tony,
Thanks for your reply. I did try using the
tag so that it considers the text box and image as one onject. But, it does not.
Any other alternative.

Thanks.
That will teach me to try / test beforehand! Red Face

Thinking a little more about it and the reason that it does not work is that the actual calendar widget is created dynamically and therefore wouldn't be contained within the div that you have. So you would have to identify that control and show/hide that one as well. As a default the calender control is created using the ID of the host control suffixed with _calendar. I've not tried or tested this myself so you would have to experiment.

Good luck

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
hi B
You can use this code to search for all the images and compare whether that image is a calendar image.Then you can use the style option to hide it.


You need to use this code somehwere in the Javascript to hide the calendat image

Thanks ,
Arvind
//get all images on the page into array
var images=document.getElementsByTagName("img");
//get the number of images in array
var 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';


WebFOCUS 714
Windows XP
Output: HTML,PDF,Excel