Joomla contact form doesn't pass W3C validation
I get the following error when I try t开发者_开发百科o validate a contact page on my site:
document type does not allow element "script" here
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).
I am using Joomla 1.5.7, and the doctype is
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Any idea how to fix this?
First, you need to update your Joomla install. 1.5.7 is nearly 2 years old and there are dozens of known security issues that have been patched. The current version is 1.5.22, you can get the patch package here - 1.5.7 to 1.5.22 patch
Next, the easy way to most likely fix your validation issue is to use the modified version of the contact page that comes with the Beez template in the core install. If you look in joomla/templates/bees/html/ you will see a folder called com_contact. Copy that to joomla/templates/[your template]/html/ and that will most likely fix the problem. If you still have the problem then you will need to track down the exact problem and what module/plugin is adding the code to the page.
精彩评论