473,748 Members | 8,933 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

javascript popup conflict

I'm having a problem with two different javascript controls in my app.
The first chuck of javascript that I pasted into my app is the
client-side calendar control popup which works fine when first used.
The second piece of javascript pasted into the app serves as a data
validation message box that fires after some server-side code executes
(if a certain error condition exists). This action is tied to a
submit button that upon NO error condition would write the data to
SQL. The calendar controls work fine until the other server-side
javascript executes then the calendar controls will pop up but when
you click on a date the window does not go away and the selected date
does not populate the textbox it is assigned to.

NOTE: VS.NET 2003 environment

HTML FROM PAGE THAT UTILIZES CALENDAR POP-UP:

<asp:TextBox id="txtStartDt " runat="server"
Width="85px"></asp:TextBox>
<SPAN id="calBlock1" >
<A href="javascrip t:calendar_wind ow=window.open( '/advtravel/calendar.aspx?f ormname=frmNewT rvlReq.txtStart Dt','calendar_w indow','width=2 30,height=230') ;calendar_windo w.focus()"><IMG
height="16" alt="Choose A Log Date" src="images/calendar.gif"
width="18" align="absMiddl e" border="0"></A>
</SPAN>

CALENDAR.ASPX HTML:

<HTML>
<HEAD>
<title>Select a date</title>
<script runat="server">
Private Sub cntCalendar_Sel ectionChanged(B yVal sender As
System.Object, ByVal e As System.EventArg s) Handles
cntCalendar.Sel ectionChanged

Dim strjscript As String = "<script language=""java script"">"
strjscript = strjscript & "window.opener. " &
HttpContext.Cur rent.Request.Qu eryString("form name") & ".value = '" &
cntCalendar.Sel ectedDate & "';window.close ();"
strjscript = strjscript & "</script" & ">"
Literal1.Text = strjscript

End Sub
</script>

<asp:literal id="Literal1" Runat="server"> </asp:literal>
<LINK href="http://localhost/AdvTravel/CSS/calendar.css"
type="text/css" rel="stylesheet ">
</HEAD>
<BODY bgcolor="silver ">
<form id="frmCalendar " runat="server">
<cc1:roundedcor ners id="RoundedCorn ers1" runat="server"
Width="190px" BorderColor="Na vy" BorderStyle="So lid" BorderWidth="2p x"
CornerHeight="2 0px" CornerWidth="20 px" Height="190px"
BackColor="Whit eSmoke">
<TABLE cellSpacing="0" cellPadding="0" align="center">
<TR>
<TD height="13">
<asp:dropdownli st id="drpCalMonth " Runat="Server" Width="100px"
AutoPostBack="T rue" OnSelectedIndex Changed="Set_Ca lendar"
CssClass="calTi tle"></asp:dropdownlis t>
<asp:dropdownli st id="drpCalYear " Runat="Server"
Width="60px" AutoPostBack="T rue" OnSelectedIndex Changed="Set_Ca lendar"
CssClass="calTi tle"></asp:dropdownlis t>
</TD>
</TR>
<TR>
<TD>
<asp:calendar id="cntCalendar " Runat="Server" Width="100%"
CssClass="calbo dy" DayStyle-BackColor="Ligh tYellow"
OtherMonthDaySt yle-BackColor="Whit e"
OnSelectionChan ged="cntCalenda r_SelectionChan ged" ShowTitle="True "
ondayrender="Ca lendar_dayrende r"></asp:calendar>
</TD>
</TR>
</TABLE>
</cc1:roundedcorn ers>
</form>
</BODY>
</HTML>

SERVER-SIDE DATA VALIDATION CODE :

Sub btnSubmit_Click (ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnSubmit.Click

StartDate = txtStartDt.Text
EndDate = txtEndDt.Text
startTime = wsdataformat.DD L2Military(ddlS tartTime.Select edValue)
EndTime = wsdataformat.DD L2Military(ddlE ndTime.Selected Value)

Select Case EndDate

Case Is < StartDate
Dim strScript As String = "<script
language=Javasc ript>"
strScript += "alert(""" & "INVALID DATE RANGE." & "\n"
& "\n" & "The END DATE cannot occur before the START DATE." & "\n" &
"\n" & "Please re-enter the dates." & """);"
strScript += "</script>"

If (Not Page.IsStartupS criptRegistered ("ErrorScript") )
Then
Page.RegisterSt artupScript("Er rorScript",
strScript)
Exit Sub
End If

Case Is = StartDate
If EndTime < startTime Then
Dim strScript As String = "<script
language=Javasc ript>"
strScript += "alert(""" & "INVALID TIMES." & "\n"
& "\n" & "The END TIME cannot occur before the START TIME." & "\n" &
"\n" & "Please re-enter the TIMES." & """);"
strScript += "</script>"

If (Not
Page.IsStartupS criptRegistered ("ErrorScript") ) Then
Page.RegisterSt artupScript("Er rorScript",
strScript)
End If
Exit Sub
End If
Submit_Validate d()

Case Is > StartDate

Submit_Validate d()

End Select

End Sub
Any help in regards to this matter would be greatly appreciated.

-Maxwell

****If there is a better way to accomplish either of the tasks
described I would definitely be open to hear about redesign options.
Thanks in advance****
Nov 19 '05 #1
0 1530

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
6508
by: Ben Wan | last post by:
I got 2 error from the following code below... 1. I couldn't load up the picture since the picture is at (C:\company\image\largePic.jpg) 2. I got a page error in my 'index.html' when calling popup(x,x,x) for the 2nd time. The code are as followed. Can anyone help please? Thank you very much~~ Ben
0
1589
by: malcolm | last post by:
How do I get a web-browser loaded with on-the-fly content and a JavaScript onclick popup function to work? I've embedded an axWebBrowser in my (vb.net) application. The browser starts with about:blank, and then I set AxWebBrowser1.Document.Body.innerHTML to the desired HTML. The HTML contains a link (which works fine) and a Javascript command to put up a popup window. (The popup will show more on-the-fly content.) The HTML and...
2
2101
by: Jeannie | last post by:
I have a popup window which is a slideshow of about 7 images. When the popup window loads, the first image is present and then the viewer can select next or previous to scroll through the rest of the images. I'd like to use the same popup window at different points throughout the website and have the Virtual Tour (slideshow) open up at the appropriate photos. Meaning I'd like to control which picture the popup window opens up to,...
3
3546
by: John Bokma | last post by:
I have two windows in a frame. I want to be able that each can open a pop up window and that the handle to that window can be stored somewhere, so that each can talk to the pop up. is it possible that window 1 in a frameset calls a function in window 2, ie. something like: window 1: ....
12
1931
by: Mark Fox | last post by:
Hello, I am attempting to do something very simple. I have a page MainPage.aspx and a popup window Popup.aspx. When users click on the linkbutton in the popup window I am looking to do some server side processing in Popup.aspx, then have the popup window close, and have the MainPage.aspx do a postback to the server. But I am having trouble determining what client side javascript Popup.aspx should render after it does its server side
9
4921
by: tshad | last post by:
This is from my previous post, but a different issue. I have the following Javascript routine that opens a popup page, but doesn't seem to work if called from an asp.net button. It seems to work fine from a link. The button does bring up the popup window, but when I press the links on the page, it doesn't return or close the window. ****************************************************************************
4
5234
by: E | last post by:
I am having trouble with setTimeout working on a second call to the setTimeout function from a second page which is an html page. Here is the scenario. I have a web page and onload it calls a javascript function which calls setTimeout and will process a second javascript function "Warn" just before the session expires. The Warn function displays an html page with a button. A second timer is started to cause the html page to close...
1
4368
by: rkagrawal | last post by:
I am not sure if this is the right forum to post about this problem , but , i just want to discuss a problem i recently encountered. I was developing a page in ASP , where i came across a problem. The last few lines of code were like this : '------ Popup page response.write("<script language=javascript>alert('Hello')</script>") response.write("<script...
5
4494
by: voidinutah | last post by:
Hello, I'm new to .NET and was trying to find a solution for having a button control do a post back then execute a javascript function. When the button is clicked a post back occurs to save the user data, after that a javascript function is called to load a new video. If it wasn't for the video, then I would have used panel controls to hide/ show the content. We are using swfobject to load a series of videos on the same page, and...
0
8987
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8826
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9534
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9366
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9316
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9241
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8239
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2777
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.