Solved

Calendar Date select pop up error

Posted on 2006-07-11
3
308 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 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

751 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