Skip to main content
Participant
February 13, 2009
Question

CFDatefield not working in FF

  • February 13, 2009
  • 6 replies
  • 9343 views
This has never happened to me: something actually works in IE and NOT in FF!

Current version of FF is 3.06. The CFdatefield input does not function in any Mozilla-based browser and throws a Javascript error: Error: "_f is undefined"
"Source File: http://localhost:8500/CFIDE/scripts/ajax/package/cfcalendar.js"

This points to a line in the JS:

"ColdFusion.Calendar.setUpCalendar=function(_6,_7,_8,_9,_a,_b,_c){
var _d=ColdFusion.DOM.getElement(_6+_b+"_cf_button",_b);
var _e=ColdFusion.DOM.getElement(_6,_b);
var _f=null;
var _10=null;
if(_e.value!=""){
_f=_e.value;
_10=_f.split("/");
}
"
Where the last two lines seem to have a problem.

Can anyone help? This appears to be either a new issue (with a new release of FF maybe) or it's a local issue with my code (everything is possible I guess :).

Robert


    This topic has been closed for replies.

    6 replies

    Participant
    May 15, 2013

    1. Check for a <p> tag without a closing </p> tag.

    2. Open beer.

    May 20, 2013

    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.

    Known Participant
    March 8, 2013

    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. 

    Participating Frequently
    October 19, 2012

    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

    name="registration" id="registration" method="post" action="#cgi.SCRIPT_NAME#">

    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?

    BKBK
    Community Expert
    Community Expert
    October 25, 2012

    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.

    BKBK
    Community Expert
    Community Expert
    October 25, 2012

    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.

    Participant
    August 8, 2012

    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.

    Participant
    September 21, 2010

    You need to add the name and id attributes to the cfform. That should work.

    Participant
    April 23, 2009

    Robert,

    Did you ever get an answer on this?  I'm having the same issue in both Firefox and IE 6.

    -Eric