Validating a text area with html inside

This is a discussion on Validating a text area with html inside within the HTML / XHTML forums, part of the Development category; How can I validate a text area that has HTML within it? I have this for it: Code: <div class="imagehold"> ...


Reply
 
LinkBack Thread Tools Display Modes
Old 18th December 2009, 05:25 PM   #1
Senior Member
 
Join Date: Jan 2009
Posts: 974
Thanks: 56
Thanked 11 Times in 11 Posts
Michael is on a distinguished road
Question Validating a text area with html inside

How can I validate a text area that has HTML within it?

I have this for it:

Code:
<div class="imagehold">
<textarea rows="10" cols="10" id="coded">
<a href="http://www.cloud9comments.com/"><img src="file:///C:/Users/Michael/Desktop/My%20Templates%20and%20Sites/Comment/images/glitterplaceholder.gif" alt="" /></a><br />
<a href="http://www.cloud9comments.com/">Get your free comments by clicking here!</a>

</textarea>
</div>
Thanks!
Michael is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 18th December 2009, 05:29 PM   #2
admin
 
saltedm8's Avatar
 
Join Date: Dec 2008
Location: Kent Uk
Posts: 1,595
Blog Entries: 6
Thanks: 15
Thanked 49 Times in 49 Posts
saltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond repute
Expertise: (X)HTML / CSS
Experience: Professional
Default

I am not going to give you the answer to this one, I want you to learn, so I want you to go to w3c and validate it, then tell me what the validator said and what you think it means...
__________________
web design kent
saltedm8 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 18th December 2009, 05:33 PM   #3
Senior Member
 
Join Date: Jan 2009
Posts: 974
Thanks: 56
Thanked 11 Times in 11 Posts
Michael is on a distinguished road
Default

I have had a look and dont understand the messages at all lol just tried html tidy to see what it said and it removes all the code and leaves the text.

Last edited by Michael; 18th December 2009 at 05:36 PM..
Michael is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 18th December 2009, 05:36 PM   #4
admin
 
saltedm8's Avatar
 
Join Date: Dec 2008
Location: Kent Uk
Posts: 1,595
Blog Entries: 6
Thanks: 15
Thanked 49 Times in 49 Posts
saltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond repute
Expertise: (X)HTML / CSS
Experience: Professional
Default

paste it here and maybe I could give you a clue or two
__________________
web design kent
saltedm8 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 18th December 2009, 05:38 PM   #5
Senior Member
 
Join Date: Jan 2009
Posts: 974
Thanks: 56
Thanked 11 Times in 11 Posts
Michael is on a distinguished road
Default

It wont validate due to the tags from the cms but this is it:

Code removed lol

Last edited by Michael; 18th December 2009 at 05:42 PM..
Michael is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 18th December 2009, 05:39 PM   #6
admin
 
saltedm8's Avatar
 
Join Date: Dec 2008
Location: Kent Uk
Posts: 1,595
Blog Entries: 6
Thanks: 15
Thanked 49 Times in 49 Posts
saltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond repute
Expertise: (X)HTML / CSS
Experience: Professional
Default

I meant paste what w3c says about it lol
__________________
web design kent
saltedm8 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 18th December 2009, 05:42 PM   #7
Senior Member
 
Join Date: Jan 2009
Posts: 974
Thanks: 56
Thanked 11 Times in 11 Posts
Michael is on a distinguished road
Default

Code:
  1. Line 11, Column 41: document type does not allow element "a" here …ref="http://www.cloud9comments.com/"><img src="images/glitterplaceholder.gif" 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).
  2. Line 11, Column 101: document type does not allow element "br" here …rplaceholder.gif" alt="" /></a><br /> 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).
  3. Line 12, Column 41: document type does not allow element "a" here …ref="http://www.cloud9comments.com/">Get your free comments by clicking 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).
Thats the whack :D
Michael is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 18th December 2009, 05:44 PM   #8
admin
 
saltedm8's Avatar
 
Join Date: Dec 2008
Location: Kent Uk
Posts: 1,595
Blog Entries: 6
Thanks: 15
Thanked 49 Times in 49 Posts
saltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond repute
Expertise: (X)HTML / CSS
Experience: Professional
Default

"document type does not allow element here" is the biggest clue mate...

in other words its basically saying 'you cant do that'


__________________
web design kent
saltedm8 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 18th December 2009, 05:45 PM   #9
Senior Member
 
Join Date: Jan 2009
Posts: 974
Thanks: 56
Thanked 11 Times in 11 Posts
Michael is on a distinguished road
Default

Well it is within the body of it, the only thing I can think of is that it needs to be wrapped with form tags possibly?
Michael is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 18th December 2009, 05:50 PM   #10
admin
 
saltedm8's Avatar
 
Join Date: Dec 2008
Location: Kent Uk
Posts: 1,595
Blog Entries: 6
Thanks: 15
Thanked 49 Times in 49 Posts
saltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond repute
Expertise: (X)HTML / CSS
Experience: Professional
Default

no, you dont get it.. the idea of that is an example of the problem, its not the problem you are having..

you have incorrectly nested a tag, and they give an example of an incorrectly nested tag.. not necessarily the same tag you have used.

sometimes nesting the tag can be the solution, but not in this case.. it has to be moved as far as I am aware
__________________
web design kent
saltedm8 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Reply

Tags
inside, validating

Thread Tools
Display Modes