The non-AMP version of that post contains the following:
<iframe style='display:none;width:0px;height:0px;' src='about:blank' name='gform_ajax_frame_8' id='gform_ajax_frame_8'>This iframe contains the logic required to handle Ajax powered Gravity Forms.</iframe>
The about:blank
URL is invalid in AMP, so the src
is getting stripped out by the sanitizer.
Fundamentally there is a plugin incompatibility problem with Gravity Forms. There are three solutions:
1) Contact Gravity Forms and see if they have any AMP solutions.
2) Remove the iframe from your post, or create a shortcode that renders the frame only if ! is_amp_endpoint()
3) We update the sanitizer to fully remove iframe
elements that get a src
stripped, since the absence of this mandatory attribute is then causing invalidity itself.
Weston,
Thanks for responding so quickly, and I apologize for my super slow reply. I just emailed Gravity Forms support about this.
Can forms be displayed on AMP pages? If they Gravity Forms doesn’t have any AMP solutions, can you update the sanitizer?
Gravity Forms support just responded and said that they don’t provide support for AMP yet. Could you update the sanitizer or give me the code to use for the shortcode to add in the functions.php file?
I don’t think that there’s any specific code that can be added to the sanitizer to make Gravity Forms “just work”. It needs to be a change with how Gravity Forms works in order to be compatible with AMP.
Bummer. Gravity Forms Support pointed me to a plugin that would have AMP display their form:
https://ampforwp.com/gravity-forms/