Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-10-19 05:40:10

Retrax
Member
Registered: 2006-10-10
Posts: 59

How could i make the W3C Validator happy?

Hello,

i wish to have these few lines in “HTML 4.01 strict” (some changes to the “comment_form” tag):

<txp:comments_error wraptag="ul" break="li" />

<p><txp:text item="Name:" /><br>
<txp:comment_name_input /></p>

<p><txp:text item="E-Mail:" /><br>
<txp:comment_email_input /></p>

<p><txp:text item="Webseite:" /><br>
<txp:comment_web_input /></p>

<p><txp:text item="Kommentar:" /><br>
<txp:comment_message_input /></p>

<p style="display:none;"><txp:comment_remember /></p>

<p><txp:comment_preview />
<txp:comment_submit /></p>

Thanks & kind regards

Michael

Last edited by Retrax (2016-10-24 15:53:22)

Offline

#2 2016-10-24 16:36:15

Retrax
Member
Registered: 2006-10-10
Posts: 59

Re: How could i make the W3C Validator happy?

The code above is embedded in an HTML 4.01 strict template i wrote, and in Textpattern is XHTML set:

TXP BackEnd > Settings > Website > Doctype > XHTML

The comments are the only thing which i can’t fix to get a valid 4.01 strict validation without “warnings”.

Errors are fixed. The Validator finds no errors at all.

The W3C Validator gives me the following warnings on the code above:

Line 56, column 88: NET-enabling start-tag requires SHORTTAG YES
…comment_name_input” id=“name” name=“name” type=“text” size=“25” value=”“ /></p>

Line 60, column 91: NET-enabling start-tag requires SHORTTAG YES
…ment_email_input” id=“email” name=“email” type=“text” size=“25” value=”“ /></p>

… and so on …

The problem is always the “/” after value=”“
Because the Doctype is not XHTML and the code in this case is (because TXP put it out as XHTML).
It seems that TXP want either XHTML or HTML5

If i remove the “/”
the result is that TXP cancel the comment-feature complete and the comment fields (Name, E-Mail, Website, Input Field,…) disappear in the Browser.

The Validator wrotes also:

For the current document, the validator interprets strings like <FOO /> according to legacy rules that break the expectations of most authors and thus cause confusing warnings and error messages from the validator. This interpretation is triggered by HTML 4 documents or other SGML-based HTML documents. To avoid the messages, simply remove the “/” character in such contexts. NB: If you expect <FOO /> to be interpreted as an XML-compatible “self-closing” tag, then you need to use XHTML or HTML5.

This warning and related errors may also be caused by an unquoted attribute value containing one or more “/”. Example: <a href=http://w3c.org>W3C</a>. In such cases, the solution is to put quotation marks around the value.

The site have to be HTML 4.01 strict.
The reasons are to complicated to explain.

So, is there a possibility to make the Validator happy (with no warnings @ HTML 4.01 strict) and handle the “/” somehow?

Or is the answer:
These are just “warnings”. The Browsers interpret the code right. The Validator says:
“This document was successfully checked as HTML 4.01 Strict!”
“Result: Passed, 9 warning(s)”

LIVE WITH IT!

Thanks & Kind Regards

Michael

Last edited by Retrax (2016-10-24 16:42:18)

Offline

#3 2016-10-24 16:40:03

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: How could i make the W3C Validator happy?

I’m wondering if you could just copy and paste the code from the parsed page and the form to keep on working. If you can, you will be able to edit it. It deserves a test.

Note though that warnings are not errors.:)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#4 2016-10-24 22:57:46

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: How could i make the W3C Validator happy?

Out of the box, there is no way to have Textpattern serve valid HTML 4 Strict – the / on input fields and other form controls and <br />.

There used to be this plugin to handle the conversion: jmd_html but that doesn’t seem to be available anymore :-(


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#5 2016-10-24 23:19:39

Retrax
Member
Registered: 2006-10-10
Posts: 59

Re: How could i make the W3C Validator happy?

I have created a “test page”, so you could read the quellcode how TXP create it:

Test Page

The “test page” is only to check it with the W3C Validator.
The page is not implemented in the TXP-Installation, so the comments does not work.
It’s only to show and read the “warnings” from the Validator:

Validator with test page

Thanks & Kind Regards

Michael

Offline

#6 2016-10-24 23:52:10

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: How could i make the W3C Validator happy?

phiw13 wrote #302451:

There used to be this plugin to handle the conversion: jmd_html but that doesn’t seem to be available anymore :-(

I happen to have JM’s Github bookmark, and there’s at least a PHP version. Retrax, you need ied_plugin_composer installed. Create a new plugin with the plugin composer, paste the PHP code into the main field, set the plugin type to “public” and order to “9”. Save and you should have the plugin installed.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#7 2016-10-24 23:56:59

Retrax
Member
Registered: 2006-10-10
Posts: 59

Re: How could i make the W3C Validator happy?

Thank you very much!!!

Offline

Board footer

Powered by FluxBB