Solved

Calendar Date select pop up error

Posted on 2006-07-11
3
306 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
ID: 17083439
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

861 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