We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7045
    • 225 Posts
    This is driving me nuts. I am working on my first modx site, and I keep getting the strict validation error... document type does not allow element "form" here. This is the only error that I am concerned with right now. I am pretty sure the reason for the error is because the form is being generated inside <p> tags. I added <p> tags around another contact form I have, and it caused it to get the same error. What’s getting me is that I can’t figure out why the <p> tags are being generated. I am also seeing <pre> tags generated after the form. I didn’t add any of these tags myself.

    The following is the link to the form that is giving me so much trouble...
    http://www.smilingdoug.com/cms_version/contact.html incase somebody wants to take a look at the code.

    The following is the chunk I made for the form...
    [+validationmessage+]
    
    <form method="post" action="[~[*id*]~]" id="ContactForm">
        <fieldset>
    
            <input name="formid" type="hidden" value="ContactForm" />
     
            <label for="cfName">Name:<br />
            <input name="name" size="40" maxlength="40" id="cfName" class="text" type="text" eform="Your Name::1:" /></label><br />
     
            <label for="cfEmail">Email:<br />
            <input name="email" size="40" maxlength="40" id="cfEmail" class="text" type="text" eform="Email Address:email:1" /></label><br />
     
            <label for="cfRegarding">Subject:<br />
            <input name="subject" size="40" maxlength="40" id="cfRegarding" class="text" type="text" eform="Form Subject::1" /></label><br />
     
            <label for="cfMessage">Message:<br />
            <textarea name="message" cols="60" rows="15" id="cfMessage" eform="Message:textarea:1"></textarea></label><br />
     
            Please enter the security code shown in the graphic below:<br />
            <img class="captcha" src="[+verimageurl+]" alt="verification code"/><br />
                    
            <label accesskey="c" for="vericode">Security Code:<br />
            <input type="text" name="vericode" size="20" /></label><br />
                    
            <label> </label>
            <p><input type="submit" name="contact" id="cfContact" class="button" value="Submit" /></p>
    
        </fieldset>
    </form>


    The following is the only code that I have in the div that the form goes in...
    <h2>[*longtitle*]</h2> 
            [*content*]
    


    Any help would be greatly appreciated.
      • 25663 MODX Staff
      • 12,272 Posts
      You can’t wrap a form in paragraph tag. Use a DIV instead. (Paragraphs can’t contain block elements, which forms and I believe fieldsets are...)
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 7045
        • 225 Posts
        I know that, but what I said in my post is that the <p> tags are being generated for some reason. Another words, I didn’t put the <p> tags there myself. I can’t figure out what I am doing to cause the <p> tags to appear there.
          • 25663 MODX Staff
          • 12,272 Posts
          What’s the [*content*] of the page in the manager (and if you’re using TinyMCE or FCK Editor, view the source directly, skipping the RTE)?
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 7045
            • 225 Posts
            Ha Ha Ha, I am so stupid, and I can’t stop laughing. I knew I was missing something. I went to the page with the content in it and set the editor to ’none’, and then I punched myself in the face. There was <p> and <pre> tags staring at me. I still don’t know how they got there, but who cares. The problem is solved. Thanks so much.