www.webdeveloper.com
Results 1 to 4 of 4

Thread: Validation Error Help Search Form

  1. #1
    Join Date
    Feb 2010
    Posts
    3

    Validation Error Help Search Form

    Hello,

    I am learning the reality of validation, I am working my way through validating a website and need help having some thing explained to me.

    Thank you in advance!!!

    I am getting the following message for the HTML Form below.

    document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag

    …ss="text" value="" name="s" id="s" /> <input class="but" type="image" src="ht

    The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

    One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
    Here is the code generating this error > THANK YOU GUYS!!

    HTML Code:
    <form method="get" id="searchform" action="http://www.website.com">	
    <input type="text" class="text" value="" name="s" id="s" ><input class="but" type="image" src="/wp-content/themes/theme896/images/search.gif" value="submit" />
    </form>

  2. #2
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    FORM elements cannot directly contain inline elements. INPUT elements are inline. You need a block level in between. Try
    Code:
    <form method="get" id="searchform" action="http://www.website.com">	
    <fieldset>
    <input type="text" class="text" value="" name="s" id="s" ><input alt="submit" class="but" type="image" src="/wp-content/themes/theme896/images/search.gif" value="submit" />
    </fieldset>
    </form>
    And you've some other problems in there as well so do read http://www.w3.org/TR/html401/interact/forms.html .
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  3. #3
    Join Date
    Feb 2010
    Posts
    3
    Thank you I will read all of it!

  4. #4
    Join Date
    Feb 2010
    Posts
    3
    It fixed the validation issue, just put a white box around the search form. I am going to read the link you provided.

    Thanks you again!!!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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
  •  
HTML5 Development Center



Recent Articles