Hi all,
Having a strange issue here. To help explain my situation, I have some images I'd like to include.
This first image is of one of two user input forms. Notice in the top left of the picture, the second tab is selected.
[IMG]http://www.abexal.org/image_1.jpg[/IMG]
The arrow is pointing to the little calendar icon. This icon, when clicked, will display a calendar date-picker tool right beside the icon.
To achieve this, I'm using the following code:
calendar = document.getElementById("calendar_popup");
icon = document.getElementById(icon);
//alert(icon.offsetParent.tagName);
if (icon.offsetParent) {
do {
coordsLeft += icon.offsetLeft;
coordsTop += icon.offsetTop;
} while (icon = icon.offsetParent);
}
calendar.style.marginLeft = 20 + "px";
calendar.style.left = coordsLeft + "px";
calendar.style.top = coordsTop + "px";
This works wonderfully in THIS form, as shown below:
[IMG]http://www.abexal.org/image_2.jpg[/IMG]
However, when I go to the tab to the right (3rd from the right of all 3 tabs). I come to another form that's identical to the one shown above. When I click on the calendar icon though, the calendar popup is displayed in the incorrect area.
[IMG]http://www.abexal.org/image_3.jpg[/IMG]
In this case, the popup is covering the calendar button. This will occur all the time between the two. It doesn't matter if one icon is selected prior to the other one.
The icons both have different ID to prevent cross-id issues.