Issue with Calendar Control not loading in Internet Explorer 9 when using ASP

I have been trying to incorporate a calendar control in my code that selects a date and returns it to a text field. It worked perfectly fine on browsers prior to IE 8, but I'm facing issues with IE 9. Can someone help me troubleshoot this problem and make the calendar control compatible with IE 9 or 10?

Message from F12 Developer Tools Console:

HTML1113: Document mode restarts from IE9 Standards to Quirks

Additionally:

SCRIPT438: Object doesn't support this property or method: 'document.all.calendar1.value'

<head>

<title>SELECT A DATE</title>

<!--<meta http-equiv="X-UA-Compatible" content="IE=8" />-->

<META http-equiv="Content-Type" content="text/html; charset=windows-1252">

<META HTTP-EQUIV="expires" CONTENT="0">

<META HTTP-EQUIV="Pragma" CONTENT="no-cache">

</head>

<BODY bottomMargin=0 leftMargin=0 topMargin=0 rightMargin=0 bgcolor=#cccac0>

<SCRIPT LANGUAGE=VBSCRIPT>

      Sub window_onunload

            window.returnvalue = formatdatetime(document.all.Calendar1.value,2)

      end sub

</SCRIPT>

<!--<SCRIPT LANGUAGE=VBSCRIPT>

      Sub window_onunload

            window.returnvalue = formatdatetime(document.getElementById("Calendar1"))

      end sub

</SCRIPT>-->

<OBJECT id="Calendar1" style="LEFT: 0px; WIDTH: 289px; TOP: 0px; HEIGHT: 198px"

classid="clsid:8E27C92B-1264-101C-8A2F-040224009C02" width=289 height=198 VIEWASTEXT class="Calendar">

<PARAM NAME="_Version" VALUE="524288">

<PARAM NAME="_ExtentX" VALUE="7646">

<PARAM NAME="_ExtentY" VALUE="5239">

<PARAM NAME="_StockProps" VALUE="1">

<PARAM NAME="BackColor" VALUE="-2147483633">

<PARAM NAME="Year" VALUE="<%=year(now())%>">

<PARAM NAME="Month" VALUE="<%=month(now())%>">

<PARAM NAME="Day" VALUE="<%=day(now())%>">

<PARAM NAME="DayLength" VALUE="1">

<PARAM NAME="MonthLength" VALUE="2">

<PARAM NAME="DayFontColor" VALUE="0">

<PARAM NAME="FirstDay" VALUE="1">

<PARAM NAME="GridCellEffect" VALUE="1">

<PARAM NAME="GridFontColor" VALUE="10485760">

<PARAM NAME="GridLinesColor" VALUE="-2147483632">

<PARAM NAME="ShowDateSelectors" VALUE="-1">

<PARAM NAME="ShowDays" VALUE="-1">

<PARAM NAME="ShowHorizontalGrid" VALUE="-1">

<PARAM NAME="ShowTitle" VALUE="-1">

<PARAM NAME="ShowVerticalGrid" VALUE="-1">

<PARAM NAME="TitleFontColor" VALUE="10485760">

<PARAM NAME="ValueIsNull" VALUE="0">

</OBJECT>

<BR>

<center><!-- <INPUT type=button value="Select Date" onClick=window.close></center> -->

<img src="selectadate.png" alt="Select a Date" onClick=window.close>

</BODY>

Answer №1

Consider substituting

document.all

for

document.forms[0]

in case there is only one form in the script

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The variable referencing an unidentified function has not been defined

I've created an anonymous function assigned to a variable in order to reduce the use of global variables. This function contains nested functions for preloading and resizing images, as well as navigation (next and previous). However, when I try to run ...

Toggle a MutationObserver using a button to stop and start monitoring for changes

Is there a way to connect a MutationObserver and disconnect it using the same button? I know how to do each separately, but I want to use just one button. How can I achieve this? Apologies for my poor English. var target = document.getElementsByClassNa ...

The policy of the Authorization Server mandates the use of PKCE for this particular request

I'm currently utilizing the authentication service provided by Hazelbase through next-auth. However, during deployment, an error message pops up stating Authorization Server policy requires PKCE to be used for this request. Please take note that Haze ...

Conceal a particular object from view by selecting it from the menu

I want to hide a specific element when the burger button is clicked. (See CaptureElementNoDisplay.PNG for the element to hide) When I click the burger button again to close the menu, I want the hidden item to be displayed once more. I've successfull ...

Maximizing the potential of typescript generics in Reactjs functional components

I have a component within my react project that looks like this: import "./styles.css"; type InputType = "input" | "textarea"; interface ContainerProps { name: string; placeholder: string; as: InputType; } const Conta ...

Struggling to unlock the mystery of a jammed trigger box

I'm currently working on implementing a small 'trigger box' that will expand upon clicking. It was functional before, but it seems to be encountering an issue now and I'm unsure of the cause. While I have some understanding of HTML and ...

What is the best way to identify a specific pattern within a string using regular expressions in JavaScript?

Looking for a way to extract specific values from a string? let temp = 'Hi {{username}}, Your request with request id: {{requestId}} has been processed. Please contact your nearest shop.' Desiring an array like this from the string: ['user ...

How can I extract an array of objects from an array of arrays containing objects?

Here is the array I am currently working with: let findAllSegmentProjectMediaFilesXref = [ { it: 0, bt: 0, items: [ { mute: false, startPosition: 10, endPosition: 20, ...

Accessing Public Photos from Facebook Users

Is it possible to create a web app that can retrieve all public photos from any user's Facebook account using their profile URL? For instance, some Facebook profiles allow non-logged in users to view profile pictures and cover photos. I am developing ...

Any ideas on how to fix the error that pops up during the installation of the bootstrap package in Node

The npm command is not recognized as a valid cmdlet, function, script file, or operable program. Please double check the spelling of the command and ensure that the path is correct before trying again. This error occurred at line 1. npm i bootstrap + ...

Using jQuery to select all child elements based on a specified condition

Is there a way to locate all instances of .post-comment-replies that have a nested '.post-comment-reply' within them, rather than being at the first level? Currently, the code provided retrieves not only those .post-comment-replies with nested . ...

Two states each offering a distinct perspective

I am currently working on modularizing my application using angular-ui-router to create a website with two states: main and checkout. In the main state, I want to have multiple "section" tags defined as ui-view items. However, it seems like there is an iss ...

Creating an automated sequence of $http requests to sequentially retrieve JSON files with numbered filenames in Angular 1.2

I have a series of JSON files (page1.json, page2.json, etc.) that store the layout details for our website pages. Initially, I would load each page's data as needed and everything was functioning smoothly. However, it is now necessary for all page da ...

Is it possible to create a replicating text box in AngularJS that multiplies when entering input

I am experimenting with creating a sequence of text boxes that dynamically generate new empty text boxes as the user enters information into each one. Each text box is required to have an ng-model value associated with it, and they should all be generated ...

Building an interactive array with checkboxes and mapping in React JS: A step-by-step guide

I am currently working on mapping a list of formations and would like to implement a dynamic array that updates when a checkbox is selected in the onChange event. The goal is to keep my organization updated with the formations they are able to dispense. ...

Limit the input to a specific format

Currently developing a JavaScript application, but having some confusion with Regular Expressions. The main goal is to allow users to input a specific format of strings in a text area for the application to process accordingly, thus requiring restriction o ...

"Proper Installation of Angular Project Dependencies: A Step-by-Step

Whenever I clone an Angular project with older versions that are missing the node_modules folder, and then run npm install to install all necessary dependencies, I end up receiving numerous warnings and errors related to version mismatches. Here are some ...

I encountered a "ReferenceError: db is not defined" while trying to call a function in Express.js with MongoDB intergr

The structure of the code is as follows: var express = require('express'); var router = express.Router(); var mongo = require('mongodb').MongoClient; function getData(){ db.collection("collection_name").find({}).toArray(function (er ...

PHP MySQL - Automatically trigger email notification upon insertion of a new record

Is there a way to trigger an email alert only when a new record is added, not when the user edits input fields in a table? The database I'm working with stores equipment delivery dates. Users schedule deliveries and input the dates into a SQL Server ...

Learn how to retrieve specific user information from a JSON file by implementing a button click feature within a custom directory using Angular.js

I am just starting to learn angular.js and I'm trying to figure out how to retrieve JSON data from a custom directory. My goal is to display the information of a specific user when a particular button is clicked, but so far I haven't been success ...