Page 1 of 1
Date field losing calendar icon when property changed
Posted: Fri Mar 21, 2014 4:19 pm
by deonreid2
I have a date field where I have the visibility it set initially to hidden. I have a checkbox with the following javascript on the onchange event.
if(get("Checkbox3") == "Y"){
applyProperty("Date1","visibility","visible");
} else {
applyProperty("Date1","visibility","hidden");
}
The problem is the date is visible when the box is checked, however, the calendar icon is never available. What could be the cause of this?
Re: Date field losing calendar icon when property changed
Posted: Fri Mar 21, 2014 4:47 pm
by David
A couple of problems here:
1. You'll want to look at the checked state of the checkbox. So try code like this:
Code: Select all
// I've always done this from the 'onclick' event, not 'onchange' event...
if(getObj("Checkbox3").checked){
applyProperty("Date1","visibility","visible");
} else {
applyProperty("Date1","visibility","hidden");
}
2. It's come to our attention recently that the calendar icon can fail to show/hide when the date field textbox is shown/hidden. If you run into this, please contact our technical support team, there is a patch available.
Re: Date field losing calendar icon when property changed
Posted: Tue Mar 25, 2014 1:25 pm
by deonreid2
I added the following statement to my java script and it solved it.:
attachCalendar("Date1");
Re: Date field losing calendar icon when property changed
Posted: Thu Jan 24, 2019 10:45 am
by Maxime
When the input element's parent (eg. layout) is display=none, then the calendar icon won't display at the correct position.