ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

EE forms and Strict HTML Validation

June 15, 2008 9:45pm

Subscribe [3]
  • #1 / Jun 15, 2008 9:45pm

    olaola

    21 posts

    I was wondering if this a known issue or there is a work around for the validation errors I am getting when any of the EE forms are used. I did a couple of test on multiple pages and my whole site validates strict when the mailing list, contact form and search forms were commented out. A couple of the things i observed when looking at the generated code is that

    1. the opening form tag is missing in all the forms

    2. the script used by the form does not specify correct attribute such as

    type="text/javascript"

    I spent a lot of time making sure my code validates Strict and would like to know if there is another way to hook into the form processor for the three forms if the EE tags won’t generate valid code. Below is an excerpt from my site

    <div id="mailing_list">
    eval(unescape("[removed]%...))
    
    <label for="mailing_list">Join our Mailing List</label>
    <input type="text" id="maillist" name="email" value="" title="type your email address here please"/>
    <input type="image" src="http://www.mysite.com/images/getit_button.gif" class="maillist_button"/>
    </form>
    
    </div>

    thanks

  • #2 / Jun 16, 2008 4:31am

    Ingmar

    29245 posts

    What template code are you using to display this form? This is from one of my sites:

    <form id='mailinglist_form' method="post" action="http://www.example.com/"  >
    <div class='hiddenFields'>
    <input type="hidden" name="XID" value="429907be0a85211902763b1d7515817debf5068c" />
    <input type="hidden" name="ACT" value="3" />
    <input type="hidden" name="RET" value="http://www.example.com/foobar/" />
    <input type="hidden" name="list" value="Foobar" />
    <input type="hidden" name="site_id" value="1" />
    </div>
    
    <input type="text" name="email" size="30" value="Enter your mail address" /> 
    <input type="submit" value=" Submit " />
    </form>

    This is the code I use:

    {exp:mailinglist:form list="Foobar"}
    <input type="text" name="email" size="30" value="Enter your mail address" /> 
    <input type="submit" value=" Submit " />
    {/exp:mailinglist:form}

    Eveything else is handled correctly by EE, including opening <form> tags.

  • #3 / Jun 16, 2008 9:11am

    olaola

    21 posts

    Not sure why your generated code is different than mine but here is the code source with EE tags for the mailing list.

    <div id="mailing_list">
           
                {exp:mailinglist:form list="default"}
                <label for="mailing_list">Join our Mailing List </label>
                <input type="text" id="maillist" name="email" value="{email}" title="type your email address here please"/>
                <input type="image" src="{site_url}images/getit_button.gif" class="maillist_button"/>
                {/exp:mailinglist:form}
          
        </div>

    I am missing these fields from your generated code.

    <form id='mailinglist_form' method="post" action="http://www.example.com/"  >
    <div class='hiddenFields'>
    <input type="hidden" name="XID" value="429907be0a85211902763b1d7515817debf5068c" />
    <input type="hidden" name="ACT" value="3" />
    <input type="hidden" name="RET" value="http://www.example.com/foobar/" />
    <input type="hidden" name="list" value="Foobar" />
    <input type="hidden" name="site_id" value="1" />
    </div>

    Instead i get a scrambled series of numbers in a script as explained in my earlier post.

    Feel free to check out the generated code source at my site

  • #4 / Jun 16, 2008 9:33am

    Ingmar

    29245 posts

    What version and build are you using? The Mailing List Module is installed and active, of course? Apart from that, does it actually work in your case; meaning, are people getting added to your mailing list?

  • #5 / Jun 16, 2008 9:37am

    olaola

    21 posts

    The mailiing list works as it should. I have received additions to my mailing list. As for build, I just purchased and downloaded EE 2 weeks a go when I started coding this site. EE 1.6.3

  • #6 / Jun 16, 2008 9:43am

    olaola

    21 posts

    I forgot to add that this issue is with all forms (email, mailing list and search) generated by EE tags , not just the contact list. I use Media Temple for hosting, so i am sure its not some quirky setting at my host.

  • #7 / Jun 16, 2008 10:12am

    Ingmar

    29245 posts

    Where does the obfuscated javascript come from? If you take a look at the source, you get:

    [removed]("<"); [removed]("f"); [removed]("o"); [removed]("r"); [removed]("m"); [removed](" "); [removed]("i"); [removed]("d"); [removed]("="); [removed]("'"); [removed]("m"); [removed]("a"); [removed]("i"); [removed]("l"); [removed]("i"); [removed]("n"); [removed]("g"); [removed]("l"); [removed]("i"); [removed]("s"); [removed]("t"); [removed]("_"); [removed]("f"); [removed]("o"); [removed]("r"); [removed]("m"); [removed]("'"); [removed](" "); [removed]("m"); [removed]("e"); [removed]("t"); [removed]("h"); [removed]("o"); [removed]("d"); [removed]("="); [removed]("""); [removed]("p"); [removed]("o"); [removed]("s"); [removed]("t"); [removed]("""); [removed](" "); [removed]("a"); [removed]("c"); [removed]("t"); [removed]("i"); [removed]("o"); [removed]("n"); [removed]("="); [removed]("""); [removed]("h"); [removed]("t"); [removed]("t"); [removed]("p"); [removed](":"); [removed]("/"); [removed]("/"); [removed]("w"); [removed]("w"); [removed]("w"); [removed]("."); [removed]("v");
    [...]

    Which, when decoded, translates to

    [removed]("<"); [removed]("f"); [removed]("o"); [removed]("r"); [removed]("m"); [removed](" "); [removed]("i"); [removed]("d"); [removed]("="); [removed]("'"); [removed]("m"); [removed]("a"); [removed]("i"); [removed]("l"); [removed]("i"); [removed]("n"); [removed]("g"); [removed]("l"); [removed]("i"); [removed]("s"); [removed]("t"); [removed]("_"); [removed]("f"); [removed]("o"); [removed]("r"); [removed]("m"); [removed]("'"); [removed](" "); [removed]("m"); [removed]("e"); [removed]("t"); [removed]("h"); [removed]("o"); [removed]("d"); [removed]("="); [removed]("\""); [removed]("p"); [removed]("o"); [removed]("s"); [removed]("t"); [removed]("\""); [removed](" "); [removed]("a"); [removed]("c"); [removed]("t"); [removed]("i"); [removed]("o"); [removed]("n"); [removed]("="); [removed]("\""); [removed]("h"); [removed]("t"); [removed]("t"); [removed]("p"); [removed](":"); [removed]("/"); [removed]("/"); [removed]("w"); [removed]("w"); [removed]("w"); [removed]("."); [removed]("v");

    This seems horribly inefficient, and does not work without javascript, needless to say. I have never seen anything like it. I cannot imagine EE having anything to do with it.

    ETA: OK, so the forum does not even let me copy the source here.

  • #8 / Jun 16, 2008 10:17am

    olaola

    21 posts

    Thats the question I have for EE . I did not add more code than I posted earlier. I thought this was EE trying to do the obfuscated javascript

  • #9 / Jun 16, 2008 10:21am

    olaola

    21 posts

    FYI

    I created a test template with just your code posted earlier.and when rendered in the Control Panel I still get the same stuff.So it is definitely EE. Maybe there is an option enabled by accident?

  • #10 / Jun 16, 2008 10:21am

    Ingmar

    29245 posts

    I’m thinking of an extension. Are you using any? The “Form Tag Encoder” would to that, eg.

  • #11 / Jun 16, 2008 10:29am

    olaola

    21 posts

    Funny you say that

    Just before you posted that I found that I had that extension installed and enabled somehow. I must have installed that instead of the “form helper plugin” like I intended. Anyway, thanks for helping thru troubleshooting the problem

  • #12 / Jun 16, 2008 10:38am

    Ingmar

    29245 posts

    Ah, I see. So, you’re good now? Working as expected?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases