Solved

Calendar Date select pop up error

Posted on 2006-07-11
3
303 Views
Last Modified: 2012-05-05
Hi there,
I have a small form within a form that I want to click a link that pops up a calendar and when a date is selected in the calendar the date will populate a textbox in the form.  

Here's my form code:
<form name="frmCalendar">
 <input name="txtDate" type="text" />
<a href="javascript:calendar_window=window.open('calendar.aspx?formname=frmCalendar.txtDate','calendar_window');calendar_window.focus()">Calendar</a>
</form>

Here's my calendar code:
Private Sub Calendar1_SelectionChanged(sender As Object, e As System.EventArgs)
Dim strjscript as string = "<script language=""javascript"">"
strjscript = strjscript & "window.opener." & HttpContext.Current.Request.QueryString("formname") & ".value = '" & Calendar1.SelectedDate & "';window.close();"
strjscript = strjscript & "</script" & ">" 'Don't Ask, Tool Bug
Literal1.text = strjscript
End Sub

I'm getting the following error when I click on a date in the calendar:

Error: 'window.open.frmCalendar.txtDate' is null or not an object.  

It seems to be in this line:
strjscript = strjscript & "window.opener." & HttpContext.Current.Request.QueryString("formname") & ".value = '" & Calendar1.SelectedDate & "';window.close();"

Any help is apprecaited.

Thanks,
Full
0
Comment
Question by:FullWilliams
3 Comments
 
LVL 27

Accepted Solution

by:
Sammy earned 300 total points
Comment Utility
Take a look at this solution http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/ASP_DOT_NET/Q_21912671.html
it doesnt use a popup instead it uses a hidden div. clean and easy to use

HTH
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now