Advertisement

05.05.2008 at 09:46PM PDT, ID: 23378522
[x]
Attachment Details

w3 texarea validation that  include html tags

Asked by hornbill in Extensible HTML (XHTML), Hypertext Markup Language (HTML)

Tags: html/xhtml

Trust a simple question?

Wondering how to achieve w3 validation for textareas containing default text with html tags.

Here's my simple example:

<form action="form1.html" method="post">
<textarea name="area1" cols="40" rows="2">testing text with no tags</textarea>
<textarea name="area2" cols="40" rows="2"><p>testing text with no tags</p></textarea>
</form>

Submitting the above to w3.org (xhtml 1.0 transitional) produces the following error at the <p> tag on the line for textarea "area2".

"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).


Start Free Trial
[+][-]05.05.2008 at 09:50PM PDT, ID: 21504840

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Extensible HTML (XHTML), Hypertext Markup Language (HTML)
Tags: html/xhtml
Sign Up Now!
Solution Provided By: hielo
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.05.2008 at 10:19PM PDT, ID: 21504913

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628