Skip to main content
Legend
September 12, 2008
Question

CFInput and others with

  • September 12, 2008
  • 2 replies
  • 452 views
I'm using CF8 and when I validate my HTML using the www.w3.org validator and I receive the following:

Line 848, Column 89: NET-enabling start-tag requires SHORTTAG YES.
…pe="text" maxlength="50" size="35" /></td>
The sequence <FOO /> can be interpreted in at least two different ways, depending on the DOCTYPE of the document. For HTML 4.01 Strict, the '/' terminates the tag <FOO (with an implied '>'). However, since many browsers don't interpret it this way, even in the presence of an HTML 4.01 Strict DOCTYPE, it is best to avoid it completely in pure HTML documents and reserve its use solely for those written in XHTML.


I think I narrowed it down to the fact that I am using <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" " http://www.w3.org/TR/html4/loose.dtd"> -- which does not expect "/>" at the end of single short tags like <input ...> tags. CF5 did not do this. Is there a wy to turn off this behaviour in CF8?

Example:

<form ...>
<input type="text" name="firstname" />
...
</form>

needs to be:

<form ...>
<input type="text" name="firstname">
...
</form>
    This topic has been closed for replies.

    2 replies

    Legend
    September 12, 2008
    It is showing up as a warning, but it still bugs me. Someday I'll change the entire site to use <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> instead, then CF8 works great, but that is a bigger project that I have time to tackle right now.

    Thanks.
    Inspiring
    September 12, 2008
    Steve Sommers wrote:
    > CF5 did not do this. Is there a
    > way to turn off this behaviour in CF8?

    I doubt it, not with the bad reputation ColdFusion had for breaking
    compliant pages in earlier versions.

    Is that an actually error that prevent validation or just a warning?

    Anyway, if it concerns you there are ways to modify your return stream
    before it is sent to the browser. The couple of times I've done this
    I've used the <onReqeust...> method of an Application.cfc file. The
    documentation has examples as does many other sites on the Internets
    available or a search.

    Be warned and read all the caveats because there are serious
    ramifications for some other ColdFusion functionality if you start
    morphing with the request like this.