ColdFusion has a problem dealing with XFN. When using ColdFusion client side validation invoked by <cfinput required="yes" />
. ColdFusion should generate JavaScript to validate the form on submission. This typically should be between in the <head />
somewhere. When using the profile
attribute of the head tag <head profile="http://gmpg.org/xfn/11" >
for XFN, ColdFusion apparently doesn’t detect a <head />
tag, and therefore dumps the contents above the <HTML>
tag. This is wrong for two reasons:
- profile is a valid attribute for the
<head>
tag [HTML4 7.4.1] - The
<script/>
is allowed in the<head>
or<body>. If the
<head>
does not exist, it should likely default to the top of the body tag as a second choice [HTML4 18.2.1]
Sample code to illustrate bug:
Does not show the bug:
Notice no profile=""
in the <head>
tag.
Ideally, ColdFusion would sniff the DOCTYPE and generate the appropriate output, for it’s JavaScript in XHTML using a CDATA.
but perhaps that’s asking to much.
FYI the server that demonstrated this is running:
server.ColdFusion.ProductLevel = Enterprise server.ColdFusion.ProductName = ColdFusion Server server.ColdFusion.ProductVersion = 7,0,0,91690 server.OS.AdditionalInformation = server.OS.BuildNumber = server.OS.Name = Windows 2003 server.OS.Version = 5.2