How use action-xhr and admin-post to send AMP form email

admin

Administrator
Staff member
I have a website in wordpress and I am doing some pages in AMP, but I need to make a compatible form with AMP, <a href="https://ampbyexample.com/components/amp-form/" rel="nofollow noreferrer">here</a> I have the documentation, I'm having some difficulties mainly to connect the "action-xhr" with wordpress. I tried to make an eternal file but I had origin-across error.
<a href=" " rel="nofollow noreferrer"><img src=" " alt="enter image description here"></a>

Code:
&lt;form target="_top" action-xhr="https://mywebsite.com/wp-admin/admin-post.php" method="post" name="test"&gt;
        &lt;input type="text" name="name" value="Name"&gt;
        &lt;input type="submit"/&gt;
    &lt;/form&gt;