WordPress.org

Ready to get started?Download WordPress

Forums

subscribe form problem (3 posts)

  1. jmps
    Member
    Posted 5 years ago #

    I want to add a very simple html form to a page, to allow people to sign up for a newsletter. I'm using Campaign Monitor to send the newsletter and manage the subscriber list. I used CM's utility to generate the form, which works fine when tested on a static html page.

    <form action="http://zzzzz.createsend.com/t/r/s/zzzzzz/" method="post">
    <div>
    <p><label for="name">Name:</label> <input type="text" name="cm-name" id="name" /></p>
    <p><label for="zzzzzz-zzzzzz">Email:</label> <input type="text" name="cm-zzzzzz-zzzzzz" id="zzzzzz-zzzzzz" /></p>
    
    <input type="submit" value="Subscribe" />

    However, when I add the form to a WordPress page and test it, nothing happens. Specifically, the data entered into the name and e-mail fields isn't sent to Campaign Monitor, and instead of being redirected to CM's standard "thank you" web page, I'm redirected to URL made up of my domain name plus a string of characters taken from the form data:

    http://mysite.net/?s=&cm-name=name&cm-zzzzzz-zzzzzz=name%40mysite.net

    I see that there is a Campaign Monitor plugin, but that would force me to use a widget and I need to have more control than that over where this little form appears, so I'd rather not use it.

    I might also note that the other forms used on the site (search forms and an e-mail form built w/ Contact 7) are working fine.

    Any ideas why WP won't let the form data be sent to the external URL? Could the problem be that method="post" instead of "get"?

  2. jmps
    Member
    Posted 5 years ago #

    Just an update: It turns out the form works if I put the code in a template file, rather than in the body of a page. That's a good enough fix, but I'm still curious why it won't work the other way, if anyone can explain it.

  3. jmps
    Member
    Posted 5 years ago #

    A further update: Now the form is also not working from the template. Any help?

Topic Closed

This topic has been closed to new replies.

About this Topic