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

    I am using Eform 1.4.4.6 on a MODX 1.0.2 site, and recieve two validation errors in XHTML 1.0 Strict.
    The following:

    there is no attribute "name"
    
    <form method="post" action="contact.html" id="EmailForm" name="EmailForm">


    And:

    there is no attribute "border"
    
    …ger/includes/veriword.php?rand=1224069188" alt="verification code" border="1"/>


    Is that because of the doctype? I know there are ongoing discussions, and that gave me the idea that "strict" is more future proof? Any suggestions here?

    Frank.
      • 33337
      • 3,975 Posts
      Yes, its because of the doctype.

      You can use css for the border styling and for the form name, try omitting that altogether and see if it works.
        Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
        • 10076
        • 1,024 Posts
        Thanks,

        I got rid of the first error by changing the form:

        Edit: did the below and now the error is

        document type does not allow element "form" here; missing one of "object", "ins", "del", "map" start-tag

        <form id="ContactForm" method="post" action="contact.html"></p>

        Here s what I changed:

        Note! In the above template we use a hidden field for the formid: <input type="hidden" name="formid" value="feedbackForm" />
        If you are using eForm 1.4+ you can instead use the id attribute of the form tag itself and leave out the hidden field: <form id="feedbackForm" method="post" action="[~[*id*]~]">. Either way will work 
        It was in the included manuals.



        Here s my form, error s probably in there?:

        <p class="error">[+validationmessage+]</p>
        <form id="ContactForm" method="post" action="[~[*id*]~]">
        	<fieldset class="login">
        
        		<legend>Uw gegevens</legend>
        		<div>
        			<label for="cfName">Volledige naam:</label>
        			<input type="text" name="name"  eform="Your Name::1:Expected at least two words:#REGEX /^\w+\s\w+/i" />
        		</div>
        		<div>
        			<label for="cfEmail">Email Address:</label>
        			<input name="email" id="cfEmail" class="email" type="text" eform="Email Address:email:1" /> 
        		</div>
        	</fieldset>
        	<fieldset class="login">
        		<legend>Uw Bericht</legend>
        		<div>
        			<label for="cfMessage">Type hier:</label>
        			<textarea name="message" id="cfMessage" class="textarea"  rows="3" cols="20" eform="Message:textarea:1"></textarea>
        		</div>
        	</fieldset>
        	<fieldset class="login">
        		<legend> Vul de code in svp:</legend>
        		<div>
        			<img src="[+verimageurl+]" alt="verification code" border="1"/>
        		</div>
        		<div>
        			<label accesskey="c" for="vericode">code</label>
        			<input type="text" class="textarea" name="vericode" size="20" /><br/>
        			<label><input type="submit" name="contact" id="cfContact" class="submit-go" value="Send" /></label>
        		</div>
        		</fieldset>
        </form>


          • 33337
          • 3,975 Posts
          form tag cannot be inside p tag.

          Regarding the id of form, you dont have to use the hidden field for the id of the form anymore as of recent eform versions. you can just add id="formId" to the form tag and eform will take care of it.

          Also, you can remove wrapping p tag from the [+validationmessage+].

          Other than that, form looks ok.
            Zaigham R - MODX Professional | Skype | Email | Twitter

            Digging the interwebs for #MODX gems and bringing it to you. modx.link
            • 10076
            • 1,024 Posts
            Hi Zi,

            without the [+validationmessage+], I dont get a message about the form validation errors.

            Also, however I use this form code:

            <form id="ContactForm" method="post" action="[~[*id*]~]">

            That returns this:
            <input type="hidden" name="formid" value="ContactForm" /></form></div>
            And does not validate, where does the input type come from?
              • 33337
              • 3,975 Posts
              Quote from: Frank at Apr 26, 2010, 07:48 AM

              without the [+validationmessage+], I dont get a message about the form validation errors.

              I meant to say that remove the <p class="errors"></p> and leave [+validationmessage+].

              Quote from: Frank at Apr 26, 2010, 07:48 AM

              Also, however I use this form code:

              <form id="ContactForm" method="post" action="[~[*id*]~]">

              That returns this:
              <input type="hidden" name="formid" value="ContactForm" /></form></div>
              And does not validate, where does the input type come from?
              eForm automatically adds the hidden input so you don’t have to. So this is normal behavior.

              Now, if you can point me to the rendered form itself on the web, I might be able to pin point what is causing the validation error.

              If you do not want to post publicly, PM me.
                Zaigham R - MODX Professional | Skype | Email | Twitter

                Digging the interwebs for #MODX gems and bringing it to you. modx.link
                • 10076
                • 1,024 Posts
                I thought so, off course the validaton is not a huge problem, but still.
                http://www.amersfoort-kinderopvang.nl/contact.html.
                That is the site url, where the "problem" is.

                Thanks, Frank.
                  • 33337
                  • 3,975 Posts
                  Looks like you will have to wrap every input within <fieldset> tag in 1.0 strict, and the last one is outside of it.

                  Does that input line present in the eForm tpl chunk?

                  The last hidden input field is definitely auto-generated by the eForm, I guess you will have to alter eForm code to wrap the field set around that required hidden input to achieve 100% validation.
                    Zaigham R - MODX Professional | Skype | Email | Twitter

                    Digging the interwebs for #MODX gems and bringing it to you. modx.link
                    • 33337
                    • 3,975 Posts
                    If you want to alter the said line, see below:

                    Replace line 100 of assets/snippets/eform/eform.inc.php
                    $tpl = str_replace('</form>',"<input type=\"hidden\" name=\"formid\" value=\"$form_id\" /></form>",$tpl);
                    

                    with this:
                    $tpl = str_replace('</form>',"<fieldset><input type=\"hidden\" name=\"formid\" value=\"$form_id\" /></form></fieldset>",$tpl);
                    


                    Not tested myself yet, please backup the original file before doing this.

                    Hope this help. smiley
                      Zaigham R - MODX Professional | Skype | Email | Twitter

                      Digging the interwebs for #MODX gems and bringing it to you. modx.link
                      • 10076
                      • 1,024 Posts
                      edit: Ah, messages crossed, here wink

                      I changed line 100

                      $tpl = str_replace('</form>',"<input type=\"hidden\" name=\"formid\" value=\"$form_id\" /></form>",$tpl);


                      into:

                      //insert hidden formid field
                      			$tpl = str_replace('</form>',"<fieldset><input type=\"hidden\" name=\"formid\" value=\"$form_id\" /></fieldset></form>",$tpl);
                      	}


                      And all was okay, now alter the css a bit to get rid of the fieldset output (an empty white border),

                      thanks loads, Frank.