We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18331
    • 20 Posts
    Hi,

    Got a problem with eform and W3C validation (doctype - Html 4.01 tansitional) on evo. I have eform call and using tpl for form. Everything works fine except W3C validation.

    One of error:

    <input name="formid" type="hidden"  value="ContactForm" />
    (NET-enabling start-tag requires SHORTTAG YES) The sequence <FOO /> 
    can be interpreted in at least two different ways, depending on the DOCTYPE of the document. 


    Of course it’s not allowed "/>", but the weird thing is that when I delete it from my tpl (making it <input name="formid" type="hidden" value="ContactForm">) the "/>" still appears in my source code. When I changing the value from "ContactForm" to "contact" this changes in source code, so not a problem in incorrect chunk linking or something. I think that eform somehow adds it’s own code to my tpl. Maybe someone had this problem?

    Thanks!
      • 4310
      • 2,310 Posts
      IIRC eForm dismantles most of the form elements then converts them into placeholders, variables etc. before rebuilding the form.
      See function buildTagPlaceholder around line 846 of assets/snippets/eform/eform.inc.php.
        • 18331
        • 20 Posts
        Thanks! No more problems with "/>". Now I got another error - there is no attribute "EFORM". Any solution for that?
          • 4310
          • 2,310 Posts
          Well, if you’ve modified the buildTagPlaceholder function it may have broken something else e.g. eFormParseTemplate around line 679 huh
            • 18331
            • 20 Posts
            Ok. Tried that:

            I uploaded the original eform.inc from modx pack back to server. This is very strange, but the error with "/>" no more exists. Now I still have that thing with "eform" atrribute.

            So my form template is:

            [+validationmessage+]
            <div id="style" class="myform">
            <form method="post" action="[~[*id*]~]#contacts">
                <input type="hidden" name="formid" value="feedbackForm">
            
                <p><label accesskey="n" for="name">Name, surname:</label>
                <input type="text" name="input-name" maxlength="60" eform="name, surname:string:1"></p>
            
                <p><label accesskey="e" for="email">E-mail</label>
                <input type="text" name="input-email" size="40" maxlength="40" eform="Your email:email:1"></p>
            
                <p><label accesskey="c" for="comments">Comment:</label>
                <textarea cols="40" rows="10" name="input-comment" eform="comment:html:1"></textarea></p>
                <button type="submit"><p>Send</p></button>
            
            </form>
            </div>
            
              • 18331
              • 20 Posts
              Anyone?:)