Same issue with a slight variation occurs in CF10. This being updated code, it's a slightly different error:
_10d=_10c.split("/"); Where 10c is undefined.
Stoney856's answer reminded me of the need for an ID, but after adding that, it still didn't work.
Turns out, I had two CFFORM's with the same ID on the page. So the calendar gets confused as to what form element we're talking about. So check for duplication of IDs on the page as well.
I am having a very similar issue, but the reverse - IE9 doesn't work, but IE8, FF, and Chrome all work fine. The error:
SCRIPT5007: Unable to get value of the property 'split': object is null or undefined --> Line 43: _10d=_10c.split("/");
The field has both name and id, as does the CFFORM. (There is only one CFFORM on the page.) I am event calling the CFAJAXIMPORT at the beginning of the file.
<cfajaximport tags="cfform,cftextarea,CFINPUT-DATEFIELD"> <cfform
Funny thing though, on the exact same code, but in another page, it works fine in all browsers.
<cfinput type="datefield" name="udf_43" id="udf_43" class="editbody" style="width:255px;" validate="date" validateat="ONSUBMIT" required="yes" message="Required Field: Please enter the information for - BIRTHDATE.">
So, what is the fix?
I tested the following code, which is equivalent to yours. It works as expected, no sweat.
<cfajaximport tags="cfform,cftextarea,CFINPUT-DATEFIELD">
<cfform name="registration" id="registration" method="post" action="#cgi.SCRIPT_NAME#">
<cfinput type="datefield" name="udf_43" id="udf_43" class="editbody" style="width:255px;" validate="date" validateat="ONSUBMIT"
required="yes" message="Required Field: Please enter the information for - BIRTHDATE.">
<cfinput type="submit" name="sbmt" value="send">
</cfform>
<cfif isdefined("form.udf_43")>
<cfdump var="#form#">
</cfif>
My versions are:
ColdFusion: 10,0,3,283145
Internet Explorer: 9.0.8112
It might help to update your IE 9 browser or ColdFusion build.
I did another test. I let the submit input tag share the same id as the datefield, namely, udf_43. I then opened the page in Firefox(16.0.1), with Firebug switched on. The result was a Javascript error: "_10c is undefined". I suppose the moral is, make sure there are no duplicate IDs on the page.
That is the strange thing, the exact same code works on one page, but not the other. There are no duplicate IDs on the page, there is only one form on the page (with a unique ID). The error is pulling from the cfcalendar.js when referenced from a single input type=datefield (as there is only one on the form). Short of upgrading to CF10 (not currently in the budget), is there a way to troubleshoot an IE version 9 only issue?
I am using CF Enterprise 9,0,1,274733 and IE 9.0.8112.
I have copied the relevant script below. I expect it to be the same for both ColdFusion 9 and 10.
ColdFusion.Calendar.setUpCalendar=function(_103,mask,_105,_106,_107,_1 08,_109){
var _10a=ColdFusion.DOM.getElement(_103+_108+"_cf_button",_108);
var _10b=ColdFusion.DOM.getElement(_103,_108);
var _10c=null;
var _10d=null;
if(_10b.value!=""){
_10c=_10b.value;
_10d=_10c.split("/");
}
What the error message is saying is that the variable _10c can be null within the if-bracket. Peculiar.I am still looking into it.
DAYohn wrote:
Interesting idea. 1. I removed the coded id. When the page renders, the id is there anyway. Still errors.
I feel we've almost cornered it. Now, a slight variation of the experiment. What happens when you test with the following code (I have changed the name attribute, too, because the built-in ColdFusion scripts may automatically generate an ID from the name)
<cfform name="registration" id="registration" method="post" action="#cgi.SCRIPT_NAME#">
<cfinput type="datefield" name="dayohn_43" class="editbody" style="width:255px;" validate="date" validateat="ONSUBMIT"
required="yes" message="Required Field: Please enter the information for - BIRTHDATE.">
<cfinput type="submit" name="sbmt" value="send">
</cfform>
<cfif isdefined("form.dayohn_43")>
<cfdump var="#form#">
</cfif>
I entered your code for the input directly and I still get the same error every time I click the calendar icon -
Message: Unable to get value of the property 'split': object is null or undefined
Line: 43
Char: 1
Code: 0
URI: https://extapps.wvu.edu/CFIDE/scripts/ajax/package/cfcalendar.js
Ignore my previous post. I have looked into the matter some more. To be sure, this appears to be a browser/Javascript compatibility problem, not a ColdFusion problem.
Apparently, it is well known that there are Javascript quirks in IE 9. The split() problem just happens to be one. One published workaound is to use the X-UA-Compatible metatag to get IE 9 to emulate IE8:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >
The error disappears when I put the following line as the very first line in the head tag.
<meta http-equiv="X-UA-Compatible" content="IE=8" />
However, I have so far succeeded in doing that only in a static HTML copy of your page. If only there was a way to get Coldfusion to dynamically insert the meta tag as first tag in the head! That would be a neat workaround.
I also discovered something absurd. The error disappears when I put the meta tag in onRequestStart, like this
<cffunction name="onRequestStart">
<cfargument name = "targetPage" type="String" required="true">
<cfif listLast(arguments.targetPage,"/") is "calendarTest3.cfm">
<meta http-equiv="X-UA-Compatible" content="IE=8" />
</cfif>
</cffunction>
However, though this works, it is messy. It places the meta tag at the very top of the page, even before the HTML doctype.
I'm running into this myself but only with Firefox 19, Chrome, IE and Safari all work correctly. Also, it only fails on some screens, others work fine. No duplicate forms or field names. Can't figure this one out. ColdFusion 9.01. Nothing on this page has fixed my situation.
Error is " _293 is undefined" in cfcalendar.js line 43.
I agree with cwhitescoe. But also check your other HTML tags. I had some bad code like this:
<table>
<cfform>
<tr><td> FORM CODE </td></tr>
</table>
</cfform>
The date picker icon would come up but woudn't show the actual date picker.
When I corrected it, by moving the cfform tag above the table tag, it worked.
North America
Europe, Middle East and Africa
Asia Pacific