Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Calendar Date select pop up error

Posted on 2006-07-11
3
Medium Priority
?
311 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 27

Accepted Solution

by:
Sammy Ageil earned 900 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

730 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