I have an input form that requests a date from the user and have a pop-up window with a calendar in it. Problem is the window shows for less than a second and then goes behind the main page. I have used this exact code in several other places with no problem. The only difference that I know of/ can see is the name of the textbox that it fills when a date is selected. Here is the piece of code from the .aspx file.

<asp:TextBox ID="txtDate" runat="server" ForeColor="#3366CC" BackColor="#E1ECFC" TabIndex="1"></asp:TextBox>&nbsp;
                <a onclick="window.open('popup.aspx?textbox=txtDate','cal','width=250,height=225,left=270,top=180')"
					href="javascript:;"><asp:ImageButton ID="imgDate" AlternateText="cal" ImageUrl="Images/SmallCalendar.gif" runat="server" TabIndex="20" /></a>

Once i bring up the window via the task bar, it works as expected. As far as i can tell, there are no javascript or asp errors.


any help would be appreciated. This is the only thing preventing this project from going live.

Thank you in advance.

Greg

onclick="window.open('popup.aspx?textbox=txtDate','cal','width=250,height=225,left=270,top=180')"
href="javascript:;"

Try

onclick="window.open('popup.aspx?textbox=txtDate','cal','width=250,height=225,left=270,top=180');return false;"
href="javascript:void(0);"

And if that fails you could always try

onclick="var w = window.open('popup.aspx?textbox=txtDate','cal','width=250,height=225,left=270,top=180');w.focus();return false;"
href="javascript:void(0);"

Try

onclick="window.open('popup.aspx?textbox=txtDate','cal','width=250,height=225,left=270,top=180');return false;"
href="javascript:void(0);"

Thanks... that worked great!!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.