Hello i have a button that clicking on it should open a pop-up with a calendar.
I'm working with IE 7.
the behaviour that follows clicking on the button is not persistent.
if i use the mouse to click the button i succeed, but when i navigate with tabs, sometimes it works right away, sometimes it needs 1-2 tries to open the window, and sometimes it doesn't succeed.
the problem is that
returns null
This is my code- - function cal_popup1 (str_datetime) {
-
this.dt_current = this.prs_tsmp(str_datetime ? str_datetime : this.target.value);
-
if (!this.dt_current) return;
-
-
var obj_calwindow = null;
-
var counter = 0;
-
while (obj_calwindow == null && counter < 10)
-
{
-
var obj_calwindow = window.open(
-
this.path + 'calendar.html?datetime=' + this.dt_current.valueOf()+ '&id=' + this.id,
-
'Calendar', 'width=200,height='+(this.time_comp ? 215 : 190)+
-
',status=no,resizable=no,top=200,left=200,dependent=yes,alwaysRaised=yes'
-
);
-
alert("hello " + obj_calwindow);
-
counter++;
-
}
-
-
if (obj_calwindow == null)
-
{
-
alert("couldn't open the window");
-
} else {
-
obj_calwindow.opener = window;
-
obj_calwindow.focus();
-
}
-
}
i would appreciate your help
13 2234 acoder 16,027
Recognized Expert Moderator MVP
Welcome to TSDN!
So how do you call this code? Can you show the button HTML markup.
this is how i call the script - <tr>
-
<td width="17"> </td>
-
<td class="text1" align="left" valign="middle" height="30">From date:</td>
-
<td align="left" valign="bottom" height="30">
-
<input type="Text" id="ONLINE_FROM"
-
name="ONLINE_FROM"
-
class="textbox" size=20
-
style="WIDTH: 152px"
-
value="15/01/2008"/>
-
<span id='calStRef'>
-
<a href='javascript:calStart.popup();'>
-
<img src="/images/cal.gif" style='position:relative; top: 3px' border="0" alt="calendar"/>
-
</a>
-
</span>
-
</td>
-
</tr>
and this is how calStart is - var calStart = new calendar1(document.forms['mmitab'].elements['ONLINE_FROM']);
and in calendar1
the code contains a reference to the first method that i wrote - function calendar1(obj_target) {
-
...
-
this.popup = cal_popup1;
-
...
-
}
one more thing i discovered - if i put the marker using the mouse on one field before the calendar button and i use 'tab' or 'shift+tab' than the pop-up opens OK
?
acoder 16,027
Recognized Expert Moderator MVP
if i use the mouse to click the button i succeed, but when i navigate with tabs, sometimes it works right away, sometimes it needs 1-2 tries to open the window, and sometimes it doesn't succeed.
I don't seem to experience this problem. Can you give a test link which demonstrates the problem? Does this only occur in IE7 or in other browsers too?
I don't seem to experience this problem. Can you give a test link which demonstrates the problem? Does this only occur in IE7 or in other browsers too?
thanks for your help, i can't give a test link since it's part of a bigger system.
i tested it on IE6 and FF as well.
in IE6 this behaviour is reproduced and in FF it works fine.
i thought that maybe something is lost or reset during the tabs navigation...
i also thought that it might be related to some pop-up blocking - but i turned it off and it didn't work.
do you know what could make the
fail?
acoder 16,027
Recognized Expert Moderator MVP
I assume by tabs navigation you mean pressing the tab key and then when the link receives focus pressing the return key?
I assume by tabs navigation you mean pressing the tab key and then when the link receives focus pressing the return key?
Yes, this is what i mean
acoder 16,027
Recognized Expert Moderator MVP
The only thing I can think of right now is that IE sometimes has a problem with th "javascript:" protocol in the href attribute (it's bad practice anyway - the href should always point to a real URL). So, the line:
[HTML]<a href='javascript:calStart.popup();'>[/HTML] could be changed to:[HTML]<a href='somepage.html' onclick="calStart.popup(); return false;">[/HTML] See if that makes a difference.
The only thing I can think of right now is that IE sometimes has a problem with th "javascript:" protocol in the href attribute (it's bad practice anyway - the href should always point to a real URL). So, the line:
[HTML]<a href='javascript:calStart.popup();'>[/HTML] could be changed to:[HTML]<a href='somepage.html' onclick="calStart.popup(); return false;">[/HTML] See if that makes a difference.
Hello,
i tried your suggestion but it didn't help entirely,
i figured that if i don't you the mouse at all before i press return on the button it doesn't work.
only after i place the marker using the mouse on some field and navigate from there, your solution works better, although not 100% of the time.
the keyboard navigation is supposed to be transparent, No?
i have another button on the screen that after i reach it using the tabs I'm not able to continue to other control using 'tab' or 'shift'+'tab'
any idea?
acoder 16,027
Recognized Expert Moderator MVP
i tried your suggestion but it didn't help entirely,
i figured that if i don't you the mouse at all before i press return on the button it doesn't work.
only after i place the marker using the mouse on some field and navigate from there, your solution works better, although not 100% of the time.
the keyboard navigation is supposed to be transparent, No?
I see what you mean. The window has to have focus for the keyboard tab navigation to work. What originally has focus?
i have another button on the screen that after i reach it using the tabs I'm not able to continue to other control using 'tab' or 'shift'+'tab'
any idea?
Post the code for this button. Is it the last button?
I see what you mean. The window has to have focus for the keyboard tab navigation to work. What originally has focus??
what initially gets the focus is the last control added to the page, when i start to move with the tabs. i start from that button
[HTML]<TD align="left"><INPUT type="button" name="cancelButton" class="BtnCreate" value="<i18n:message key="link.cancel"/>" onclick="window.close()" style="width : 80;"></TD>[/HTML]
Post the code for this button. Is it the last button?
i found the problem the button had an attribute [HTML]onFocus="window.focus()"[/HTML], after i removed it the tabs go O.K.
so now the only problem is that the window doesn't open :(
acoder 16,027
Recognized Expert Moderator MVP
i found the problem the button had an attribute [HTML]onFocus="window.focus()"[/HTML], after i removed it the tabs go O.K.
Well, that was going to cause problems. Good spot.
so now the only problem is that the window doesn't open :(
Even if the button/link has focus?
Even if the button/link has focus?
what do you mean has focus?
when i hit return it attempts to open the pop-up - this means that it has focus, right?
acoder 16,027
Recognized Expert Moderator MVP
what do you mean has focus?
when i hit return it attempts to open the pop-up - this means that it has focus, right?
Yes, that's correct. Can you produce a test version that demonstrates this problem?
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: ajay |
last post by:
How to make a new page appear in tab instead of new window. I use Netscape 7+.
Is there any provision to do in HTML language ?
Ajay
|
by: George Hester |
last post by:
http://tinyurl.com/5uj6w
The lower middle icon the "block" should not drop down when the mouse is over it. How can I stop that?
Also the navigation divs both top and bottom should follow the...
|
by: D. Alvarado |
last post by:
Hello,
I am trying to open a window containing an image and I would like
the image to be flush against the window -- i.e. have no padding or
border. Can I make this happen with a single call to a...
|
by: sjp |
last post by:
I need to open new windows only for the purpose of viewing linked
images, maybe a dozen or so throughout the site. Using the
Target="blank" command is quick, easy and seems like the best way to...
|
by: Viken Karaguesian |
last post by:
Hello all,
On occasion I want to open hyperlinks (images, etc.) in a new window. In the
past, I've used target="_blank" to open the link in a new window. However,
using the "target" attribute...
| |
by: OtisUsenet |
last post by:
Hello,
I have some onClick events in <a href...> elements, so they get called
when a user clicks on a link.
This works well, and looks like this:
<a onclick="onLinkClick(123);"...
|
by: John |
last post by:
Tried this on microsoft.public.access.gettingstarted - no response -
perhaps more appropriate here.
I'm not a database user, simply helping someone get started with a new
computer.
The old...
|
by: fishwick |
last post by:
I haven't really done any css in quite a while, and am banging my head
against the wall trying get the rudimentary layout together of a church
website home page to display correctly - I don't want...
|
by: pbd22 |
last post by:
Hi.
I have built a site with tabs-based navigation as a pretty major
component. The tabs use window.location.href to understand
where the user is and displays the appropriate tabs accordingly....
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |