Copy link to clipboard
Copied
CF9 (NOT CF901), no hotfixes, no updates, no patches.
CFFORM with name and ID parameters, nothing else.
Form contains two text fields (both are used for date in MM/DD/YYYY format),
six checkboxes (all unique name/id), two radio (both same name/id), and a submit button.
The text fields, checkboxes, and radio are all <INPUT>, the submit is <CFINPUT>.
NONE of the names/ids contain underscore or hyphen or anything other than
alpha characters (not even numbers.)
Regardless of whether the "Start Date" is 1/1/2011 or 01/01/2011, when the submit
button is clicked, an alert box will display "Invalid Start Date Format. Use MM/DD/YYYY",
and the form will submit, anyway.
There is not any JavaScript validation; there are no parameters or settings asking CF to validate.
Has anyone else run across this "ghost" validation error?
Thanks,
^_^
Copy link to clipboard
Copied
Pls don't describe the code, just post it (as minimal a repro case as you can contrive that demonstrates the issue). It'll make it easier to investigate what you're seeing.
--
Adam
Copy link to clipboard
Copied
The action and method have been added by another developer since I made my original post.
Same for the CFSELECT.
<cfform id="reportFilters" action="reportContent.cfm" method="post" >
<table id="filter-selection">
<tr>
<td><input type="radio" name = "level" value="directReports" checked/>
Direct Reports</td>
<td><input type="radio" name = "level" value="wholeOrg" />
Whole Organization</td>
<td><input type="checkbox" id="management" name="management" checked="checked" />
<label for="management">Management</label></td>
<td><input type="checkbox" id="nonManagement" name="nonManagement" checked="checked" />
<label for="nonManagement">Non-Management</label></td>
<td>*These filters apply to all sections</td>
</tr>
</table>
<h2> Report by Course</h2>
<cfselect query="courses" name ="courseDropdown" display="course_title" queryPosition="below" >
<option>Select Course</option>
</cfselect>
<h2>Report by Training Programs</h2>
<cfselect query="trainPrograms" name ="tpDropdown" display="training_program_name" queryPosition="below">
<option>Select Training Program</option>
</cfselect>
<h2>Custom Report Filters</h2>
<table id="filter-selection">
<tr>
<td id="filter-include"><span class="title">include</span>
<input type="checkbox" id="toggleNotEnrolled" name="toggleNotEnrolled" checked="checked" />
<label for="toggleNotEnrolled">Not Enrolled</label>
<input type="checkbox" id="toggleEnrolled" name="toggleEnrolled" checked="checked" />
<label for="toggleEnrolled">Enrolled</label>
<input type="checkbox" id="toggleComplete" name="toggleComplete" checked="checked" />
<label for="toggleComplete">Completed</label></td>
<td id="filter-cal"><input value="#calStart#" type="text" id="calStartDt" name="calStartDt" size="10" />
<img id="calstartimg" class="calendar-img" src="images/calendar.png" />
<input value="#calEnd#" type="text" id="calEndDt" name="calEndDt" size="10" />
<img id="calendimg" class="calendar-img" src="images/calendar.png" />
<button type="submit" id="updatebtn"><img src="images/update_btn.png" /></button></td>
</tr>
</table>
<!--- additional filtering options --->
<div id="filter-options1">
<table>
<tr>
<th colspan="2" class="edge">type of training</th>
<th>delivery method</th>
</tr>
<tr>
<td></td>
<td></td>
<td><input type="checkbox" id="toggleWBT" name="toggleWBT" checked="checked" />
<label for="toggleWBT">WBT (Web-Based)</label></td>
</tr>
<tr>
<td><input type="checkbox" id="toggleRequired" name="toggleRequired" checked="checked" />
<label for="toggleRequired">Required IT</label></td>
<td class="edge"><input type="checkbox" id="toggleOptional" name="toggleOptional" checked="checked" />
<label for="toggleOptional">Optional</label></td>
<td><input type="checkbox" id="toggleILT" name="toggleILT" checked="checked" />
<label for="toggleIlT">ILT (Instructor-Led)</label></td>
</tr>
</table>
</div>
<cfinput type="submit" value="Export" name="submitButton" />
</cfform>
Copy link to clipboard
Copied
.. and it's not happening in IE7, but it does happen in FF3, FF4, and Chrome.
^_^
Copy link to clipboard
Copied
Maybe you missed this bit: "as minimal a repro case as you can contrive that demonstrates the issue"
Get rid of the HTML and everything else that is not necessary to demonstrate your issue. Don't just slap they whole lot in there.
Factoring things out of code that's not behaving should be one of your initial troubleshooting steps as you try to work out what's wrong.
--
Adam
Copy link to clipboard
Copied
The original developer was using jQuery to validate form fields in forms contained within an object with a specific name; changing the name of the div prevents form validation. Still doesn't explain why it was considering valid date formats (1/1/2011 or 01/01/2011) as invalid, but we at least got the form to submit without giving an alert message.
^_^
Copy link to clipboard
Copied
WolfShade wrote:
Still doesn't explain why it was considering valid date formats (1/1/2011 or 01/01/2011) as invalid, but we at least got the form to submit without giving an alert message.
It just might be that, for your locale, the valid format is 2011/01/01
Copy link to clipboard
Copied
No. The mask used for validation is m/d/yyyy or mm/dd/yyyy, I'm in the US where most people use mm/dd/yyyy, and when it comes to inserting/updating the database, the format doesn't really matter as long as you use something like #CreateODBCDateTime()#.
Something to try and figure out, later, as this is doing what it's supposed to be doing, and the deadline is today.
^_^
Copy link to clipboard
Copied
Actually, it might matter. Both formats you mention are ambiguous for the first 12 days of the month.
Copy link to clipboard
Copied
Even so, 1/1/2011 (Jan 1 2011) is the same as 1/1/2011 (1 Jan 2011) - both should have been valid (it is the default date entered in the field when the form loads.) And validation for this form really isn't necessary, anyway. Most people who use this internal corporate web app will not be altering the date fields.
^_^