/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Help with datepicker script

I’m running this script [url]http://www.nsftools.com/tips/DatePickerTest.htm[/url]

on a php page, and in Firefox its fine, but in IE I get a “null” is null or not an object error right around here:

[code=php]function updateDateField(dateFieldName, dateString)
{
var targetDateField = document.getElementsByName (dateFieldName).item(0);
if (dateString) {
targetDateField.value = dateString;
}

var pickerDiv = document.getElementById(datePickerDivID);
pickerDiv.style.visibility = “hidden”;
pickerDiv.style.display = “none”;

adjustiFrame();
targetDateField.focus();

// after the datepicker has closed, optionally run a user-defined function called
// datePickerClosed, passing the field that was just updated as a parameter
// (note that this will only run if the user actually selected a date from the datepicker)
if ((dateString) && (typeof(datePickerClosed) == “function”)) {
datePickerClosed(targetDateField);
}
}[/code]

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@JMRKERSep 19.2007 — I'm not getting the error you report when running IE6 on the link you provided.

Any other symptoms?

Line number where error occurs?
Copy linkTweet thisAlerts:
@chrisHHRauthorSep 19.2007 — I found it last night....I had another Javascript function on the page with the same field name as the date field, though lower case. Firefox was able to tell the difference, but IE couldn't handle it.
Copy linkTweet thisAlerts:
@JMRKERSep 19.2007 — I guess I couldn't see it because it wasn't there! ?

Good luck.
×

Success!

Help @chrisHHR spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...