PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Page will not validate with form in it unless I remove filters

  1. I've run into this problem on about 4 different sites. When I embed a Gravity Form in a page or post, using the Gravity Form shortcode, the rendered page will not validate unless I remove the formatting using this procedure:

    http://www.catswhocode.com/blog/top-10-wordpress-hacks-from-june-09
    "Disable WordPress automatic formatting on posts using a shortcode"

    Basically, I wrap the Gravity Form shortcode in this new [raw] shortcode, and the validation errors go away.

    Any ideas?

    Using WP 2.9.2 and GF 1.3.10. Have seen the problems with 3 StudioPress themes and the theme where I am having trouble right now happens to be the Reptile framework.

    I was going to post the source here, and the validator messages, but I just realized it's a draft post and I am logged in so there is all sorts of admin/nonce stuff in the source that I'd rather not post. Here is the gist of the errors though:

    #  Error  Line 114, Column 4: end tag for element "p" which is not open
    </p></form>
    
    # Error Line 115, Column 4: end tag for element "p" which is not open
    </p></div>

    There are 6 other errors after that, but only because of these two.

    Here is the relevant source of the rendered page:

    <div class='gform_footer top_label'>
    <input type='submit' class='button' value='Submit' tabindex='4'/>&nbsp;&nbsp;<a href='http://www.example.com/wp-admin/admin.php?page=gf_edit_forms&id=3'>Edit this form</a>
    
                            </div>
    </p></form>
    </p></div>

    Looking at that now, is it possible the validation error would only be because I am logged in, and a visitor would never see it if they're not seeing the edit button? I always validate the page before publishing it, from the preview, so maybe this validation error only happens because I am logged in?

    I can check another post later after publishing it, but can't log out and see the preview here (sort of a catch 22.)

    If this is a validation error only for logged in members with permission to edit, can you fix that so I can stop worrying about it?

    Thank you

    Posted 9 years ago on Sunday March 14, 2010 | Permalink
  2. I published the post and it still has validation errors. If I wrap the GF shortcode in that [raw] shortcode, the errors go away. Here is the post:

    http://www.pack24riverside.org/cub-scout-pack-24-faqs/

    That page will have validation errors (I did not wrap the form shortcode in the [raw] shortcode. Here is the form output from the source:

    <div class='gform_wrapper' id='gform_wrapper_3' >
    <form method='post' enctype='multipart/form-data' id='gform_3' class='' action=''>
    <div class='gform_heading'>
                                <span class='gform_description'>If you have a question which is not addressed here, please feel free to submit and we’ll get right back to you.</span>
                            </div>
    <div class='gform_body'>
    <input type='hidden' class='gform_hidden' name='is_submit_3' value='1'/>
    
    <ul id='gform_fields_3' class='gform_fields top_label'>
    <li id='field_3_1' class='gfield' ><label class='gfield_label' for='input_3_1'>Name<span class='gfield_required'>*</span></label>
    <div class='ginput_container'>
    <input name='input_1' id='input_3_1' type='text' value='' class='medium' tabindex='1' /></div>
    </li>
    <li id='field_3_2' class='gfield' ><label class='gfield_label' for='input_3_2'>Email<span class='gfield_required'>*</span></label>
    <div class='ginput_container'>
    <input name='input_2' id='input_3_2' type='text' value='' class='medium' tabindex='2' /></div>
    </li>
    <li id='field_3_3' class='gfield' ><label class='gfield_label' for='input_3_3'>Your Question<span class='gfield_required'>*</span></label>
    <div class='ginput_container'><textarea name='input_3' id='input_3_3' class='textarea medium' tabindex='3'  rows='10' cols='50'></textarea></div>
    
    </li>
    </ul></div>
    <div class='gform_footer top_label'>
    <input type='submit' class='button' value='Submit' tabindex='4'/>
                            </div>
    </p></form>
    </p></div>

    Not sure why there are closing P before the closing form and closing gform_wrapper div.

    Posted 9 years ago on Sunday March 14, 2010 | Permalink
  3. This is odd for sure. Nobody else has reported anything like this. I'm personally unable to recreate your problem and there's nothing in the code I can find that should be adding the extra erroneous markup.

    Using the same WordPress and Gravity Forms versions, I recreated your form on a blank page template with no other structural markup or scripts.. just basic header stuff.

    screenshot

    I check the markup and don't see any misplaced </p> tags or anything else out of place

    screenshot

    and when I run it through the validator, it validates properly with no alerts or errors.

    screenshot

    I've actually reconfigured the form several times, different fields, conditional logic, etc. all with similar results. I even removed and re-added the shortcode in both the visual and html editors without any detrimental effects.

    Are there any other commonalities in the affected sites? All on the same web host?

    Posted 9 years ago on Sunday March 14, 2010 | Permalink
  4. Yes, all on the same web host. Actually, different machines, same hosting company (1&1).

    Could it be another plugin? Why would wpautop be running on the output from your plugin? (at least, that's what it seems like to me, since removing that filter removes the problem.)

    This last site has the fewest number of plugins and is not really in use yet, so disabling all plugins here is not a problem. This is the first time I've used the Reptile framework, which made it seem even even weirder, since I just chalked it up to StudioPress themes in the past and it was easy enough to work around with using the [raw] shortcode.

    Finally, this form happens to be really simple. Just three fields, no conditional logic.

    The only other thing I do is always disable the visual editor for all my accounts. Not sure if that matters. I sent a login to this site using the contact form.

    Posted 9 years ago on Sunday March 14, 2010 | Permalink
  5. The other thing I always do is put my form at the bottom of a post or page. There's always content above it, then the form gets embedded.

    Posted 9 years ago on Sunday March 14, 2010 | Permalink
  6. Got the login and will check it out. Thanks for the other info. I'll let you know what I can figure out.

    Posted 9 years ago on Sunday March 14, 2010 | Permalink
  7. Chris, we agree that it's coming from the wpautop filter, but can't get a handle on why it's randomly happening since we haven't been able to replicate it. We have some ideas but without being able to replicate the problem, it's difficult to come up with a fix.

    Do you have a site that's affected that we can tinker with.. one that's not live yet or something that Alex can look at. If so, can you send FTP Login via the contact form so he can get in there and do his magic?

    Posted 9 years ago on Monday March 15, 2010 | Permalink
  8. Created a test site with WP 2.9.2 and GF 1.3.10. I sent the login information and FTP login information using the support form.

    Other things I thought of that were common to most of the forms I use.

    1. I almost never use the form title but normally do use the form description
    2. I almost never allow comments on posts

    Let me know if you need anything else.

    You can do whatever you want to that site (post, delete posts, pages, etc), it's not live in any meaningful way.

    Thanks

    Posted 9 years ago on Tuesday March 16, 2010 | Permalink
  9. In the email confirmation of my support form submission to you, it appears some of the information is missing. I submitted more and am unsure if you got it and the notification email is wrong, or if not everything made it through. Let me know if you need more info than was in the contact form submission.

    Actually, I just looked and it appears special characters in the WordPress login password ended up messing up my confirmation. Just let me know if you got all the data. I can forward this notification if you'd like to see it. You can contact me at chrishajer [at] gmail [dot] com and delete this reply if you like.

    Posted 9 years ago on Tuesday March 16, 2010 | Permalink
  10. Thanks Chris. We did get the login info so we'll be checking it out.

    Posted 9 years ago on Tuesday March 16, 2010 | Permalink

This topic has been resolved and has been closed to new replies.