I am trying get Javascript popup calendar control to work which doesnt work. I am getting
an error “Microsoft JScript runtime error: ‘window.opener.document.forms(…).control’ is null or not an object”. Here is my event,
protected void Change_Date(System.Object sender, System.EventArgs e)
{
string strScript = "<script>window.opener.document.forms(0)." + control.ClientID + ".value = '";
strScript += calDate.SelectedDate.ToString("MM/dd/yyyy");
strScript += "';self.close()";
strScript += "</" + "script>";
ClientScript.RegisterClientScriptBlock(this.GetType(), "Startup", strScript);
}
It displays the calendar fine but when I click on the date, I am getting the error and the date is inserted into the textbox.
wrong brackets:
should be