Solved

Datefield CFINPUT not working Firefox 3.0.8

Posted on 2009-04-06
5
982 Views
Last Modified: 2013-12-16
I have a script (see code) which works in IE7, but not Firefox.  Please help me understand why.
<table width="100%" border="0" cellspacing="0" cellpadding="3">
  <tr>
    <td colspan="2">Select a date range to obtain the registrants.</td>
  </tr>
  <cfform name="form1" method="post" action="">
  <tr>
    <td width="10%">Start Date:</td>
    <td width="90%">
    <div style="position:relative; z-index:5">
    <cfinput type="datefield" name="st_dt" id="st_dt">
    </div>
    </td>
  </tr>
  
  <tr>
    <td>End Date:</td>
    <td>
<div style="position:relative; z-index:3">
<cfinput type="datefield" name="end_dt" id="end_dt">
</div>
</td>
  </tr>
  </cfform>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>

Open in new window

0
Comment
Question by:day6
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 500 total points
ID: 24079117
I do not the exact cause, but it seems to be related to the nesting of the form/fields and <table> tags.  Try moving the cfform outside of the <table>
<cfform name="form1" method="post" action="">
<table width="100%" border="0" cellspacing="0" cellpadding="3">
  <tr>
    <td colspan="2">Select a date range to obtain the registrants.</td>
  </tr>
  <tr>
    <td width="10%">Start Date:</td>
    <td width="90%">
    <div style="position:relative; z-index:5">
    <cfinput type="datefield" name="st_dt">
    </div>
    </td>
  </tr>
  
  <tr>
    <td>End Date:</td>
    <td>
<div style="position:relative; z-index:3">
<cfinput type="datefield" name="end_dt">
</div>
</td>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
  </tr>
</table>
</cfform>

Open in new window

0
 
LVL 1

Author Comment

by:day6
ID: 24080877
This did not fix it.
0
 
LVL 27

Expert Comment

by:azadisaryev
ID: 24083871
_agx_'s edited code with proper tag nesting works just fine in FF3.0.8
if it does not work for you - the problem is elsewhere. post all your code.

Azadi
0
 
LVL 1

Author Comment

by:day6
ID: 24090446
It works at this point, but I haven't been able to get the date to display properly and the MASK feature of the cfinclude doesn't make it display as my MySQL requires. I'd prefer not having to parse the form field results into pieces to get it into my database when I can simply have it in the proper order.

CFINCLUDE defaults the datefield to mm/dd/yyyy when I want it to be yyyy-mm-dd

What can I do?
0
 
LVL 52

Expert Comment

by:_agx_
ID: 24091202
It must be a problem with your code.  The mask attribute of _cfinput_ works just fine:
     <cfinput type="datefield" name="st_dt" mask="YYYY-MM-DD">

> I'd prefer not having to parse the form field results into pieces to get it into my database
> when I can simply have it in the proper order

It is best never to trust form values and always validate on the server side.  Besides, formatting is only an issue when you use date _strings_. The correct way is to use date/time objects.  With date/time objects, there is no ambiguity and the database will properly interpret the date value:

<cfquery....>
INSERT INTO someTable (DateColumn)
VALUES
(
<cfquery value="#dateString#" cfsqltype="cf_sql_timestamp">
)
</cfquery>
0

Featured Post

RoboForm Secure Password Management System

RoboForm Everywhere - Superb Browser Support
Windows / Apple / IOS / Android / Linux / Chrome OS
Use different complex passwords everywhere
Best Secure Password Management by far
Synchronize all of your devices instantly
Safe, Secure & Highly Recommended!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
What is the best password manager? 12 192
FireFox Add-on Plugins 4 52
SEC_ERROR_REVOKED_CERTIFICATE In Firefox 5 73
Chrome's stance on self-signed certificates? 3 25
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question