This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 2
w3c validation error with pasted php
Started 16 years ago by reprocessor | 7 posts |
-
Afternoon Gents,
I'm getting this error when I run my page through the w3c validator - any suggestions?
The php code that machform generates is pasted into a php page. The error is below. If you need more details please let me know.
here's a link to my page: http://www.getaquoteaberdeen.co.uk/index2.php
Validation Output: 1 Error
1. Error Line 18, Column 121: document type does not allow element "link" here.
…ta/form_4/css/view.css" media="all" />
The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).
One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).
Posted 16 years ago # -
This one is a bit problematic. Since MachForm need to use its own CSS file, thus when you use the PHP embed code, the CSS call is being made at the middle of your page -- which broke your page validation.
This is the line which causing error:
<link rel="stylesheet" type="text/css" href="http://www.getaquoteaberdeen.co.uk/./data/form_4/css/view.css" media="all" />
To solve this, you need to do two things:
1) Copy the above CSS call and paste into your
<head></head>
section.2) Edit your includes/view-functions.php file, search around line 2153 for this code:
if(empty($edit_id)){ $css_markup = "<link rel=\"stylesheet\" type=\"text/css\" href=\"{$machform_path}{$css_dir}view.css\" media=\"all\" />"; }else{ $css_markup = "<link rel=\"stylesheet\" type=\"text/css\" href=\"edit_entry.css\" media=\"all\" />"; }
comment the css markup above, to become like this:
if(empty($edit_id)){ $css_markup = "<!--<link rel=\"stylesheet\" type=\"text/css\" href=\"{$machform_path}{$css_dir}view.css\" media=\"all\" />-->"; }else{ $css_markup = "<link rel=\"stylesheet\" type=\"text/css\" href=\"edit_entry.css\" media=\"all\" />"; }
That would hide the CSS call from your page body.
MachForm Founder
Posted 16 years ago # -
Yuniar, you truly are a god.
Thanks for this, it validates perfectly now. I'm sooooooo chuffed :)
Cheers,
Phil
Posted 16 years ago # -
I have a similar issue, Yuniar. I am using the php version of the code (instead of iframe) and have the same problem as reprocessor. So I modified the includes/view-functions.php files in NotePad++ as you suggested, and the solution "half works":
Yes, the html does validate, but the formatting of the form is lost
Saying it in a different way, depending on what I do (with exactly the SAME html file with the css call put in the head) I get:
- if I use the original view-functions.php file, then w3c validation fails but the php form has nice formatting
- if I use the modified view-functions.php file, then w3c validation suceeds but the php form has no formatting:
http://www.redrockdental.org/patient-testimonial.phpWhat should I do? Thanks!
Posted 13 years ago # -
Btw, Yuniar, may I ask you to email me the original view-functions.php file (that comes with the installation), because perhaps I played too much with it (saving in different formats). Just in case...maybe this has nothing to do with the above problem. Thanks again.
Posted 13 years ago # -
I checked into your page and it seems the reference to the CSS file is being commented:
<!--<link rel="stylesheet" type="text/css" href="http://www.redrockdental.org/machform/./data/form_2/css/view.css" media="all" />-->
I think you should change it to become:
<link rel="stylesheet" type="text/css" href="http://www.redrockdental.org/machform/./data/form_2/css/view.css" media="all" />
You can download the original package by logging in to customer area. Or please contact us directly through email: customer.service [at] appnitro.com
I'll send the file there.
MachForm Founder
Posted 13 years ago # -
Thank you, Yuniar, all works now. Cheers and all the best!
Posted 13 years ago #
Reply
You must log in to post.