Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Validating a text area with html inside

  1. #1
    Elite Member Michael's Avatar
    Join Date
    Jan 2009
    Posts
    1,091

    Question Validating a text area with html inside 18 Dec 2009 @ 17.25

    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!
      Reply With Quote

  2. #2
    Administrator saltedm8's Avatar
    Join Date
    Jun 2011
    Posts
    2,182
    Blog Entries
    3

    Default 18 Dec 2009 @ 17.29

    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...
      Reply With Quote

  3. #3
    Elite Member Michael's Avatar
    Join Date
    Jan 2009
    Posts
    1,091

    Default 18 Dec 2009 @ 17.33

    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; 18 Dec 2009 at @ 17.36.
      Reply With Quote

  4. #4
    Administrator saltedm8's Avatar
    Join Date
    Jun 2011
    Posts
    2,182
    Blog Entries
    3

    Default 18 Dec 2009 @ 17.36

    paste it here and maybe I could give you a clue or two
      Reply With Quote

  5. #5
    Elite Member Michael's Avatar
    Join Date
    Jan 2009
    Posts
    1,091

    Default 18 Dec 2009 @ 17.38

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

    Code removed lol
    Last edited by Michael; 18 Dec 2009 at @ 17.42.
      Reply With Quote

  6. #6
    Administrator saltedm8's Avatar
    Join Date
    Jun 2011
    Posts
    2,182
    Blog Entries
    3

    Default 18 Dec 2009 @ 17.39

    I meant paste what w3c says about it lol
      Reply With Quote

  7. #7
    Elite Member Michael's Avatar
    Join Date
    Jan 2009
    Posts
    1,091

    Default 18 Dec 2009 @ 17.42

    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
      Reply With Quote

  8. #8
    Administrator saltedm8's Avatar
    Join Date
    Jun 2011
    Posts
    2,182
    Blog Entries
    3

    Default 18 Dec 2009 @ 17.44

    [FONT=monospace]"document type does not allow element here" [/FONT]is the biggest clue mate...[FONT=monospace]

    [/FONT]in other words its basically saying [FONT=monospace]'you cant do that'


    [/FONT]
      Reply With Quote

  9. #9
    Elite Member Michael's Avatar
    Join Date
    Jan 2009
    Posts
    1,091

    Default 18 Dec 2009 @ 17.45

    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?
      Reply With Quote

  10. #10
    Administrator saltedm8's Avatar
    Join Date
    Jun 2011
    Posts
    2,182
    Blog Entries
    3

    Default 18 Dec 2009 @ 17.50

    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
      Reply With Quote

Page 1 of 2 12 LastLast

Similar Threads

  1. Validating a form with PHP
    By webmachine in forum PHP, ASP & Java
    Replies: 9
    Last Post: 2 Jun 2010, @ 02.02
  2. Remove vertical scroll bar on text area
    By Michael in forum HTML & CSS
    Replies: 1
    Last Post: 27 Jan 2010, @ 17.10
  3. Need Help Validating Embedded Code.
    By Wrams in forum HTML & CSS
    Replies: 6
    Last Post: 22 Oct 2009, @ 10.04
  4. Help validating a page with video on it.
    By woodencigars in forum Imagery, Graphics & Typography
    Replies: 8
    Last Post: 12 Mar 2009, @ 22.55

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •