Inserting a form on a Page (11 posts)

  1. scruffy
    Posted 10 years ago #

    How can I include a form in a Page? When i try, it seems to completely ignore the form tag and any of the form elements. Although, the preview at the bottom of the Write Page page shows it correctly (using the admin style, though).

    It's really odd. When i view the source of the resulting page, the form is completely gone, but the labels I put before the text entry boxes are still there.

    I tried turning off "WordPress should correct invalidly nested XHTML automatically," and re-posting the page, but it didn't work.

  2. Jaqueline
    Posted 10 years ago #

    Scruffy, I use a regular form on "Pages".

    I created two pages, onde for the form, and another one with the "Thank you" message.

    Very simple, and it send using FormMail CGI. There are a lot of plugins for contact form here, but I wanted something very simple.

    here is the code I inserted on my page:

    <form action="http://maismoda.com.br/cgi-sys/FormMail.cgi" method="POST">
    <input type=hidden name="recipient" value="my@email.com.br"/>
    <input type=hidden name="redirect" value="http://www.jaquelinegirardi.com.br/english/?page_id=25"/>

    Your name:
    <input type=text name="realname" size="40"/>

    Your email:
    <input type=text name="email" size="40"/>

    <select name="attn" size="1">
    <option value=" Jackie Girardi ">Designer Jaqueline Girardi
    </option><option value=" Sales Jaqueline Girardi ">Sales Jaqueline Girardi
    </option><option value=" Webmaster ">Webmaster

    <input type=text name="subject" size="40"/>

    <textarea name="comments" rows="4" cols="40"></textarea>

    <input type=submit value="submit"/> </form>

    You can see it working at: http://www.maismoda.com.br/english

  3. Michael Adams (mdawaffe)
    Posted 10 years ago #

    If you're having trouble getting the markup you want working by typing it into a Page's content, you can make a Custom Page Template. Put the form markup in the Template, and just tell the Page to use that Template instead of the default one.

  4. scruffy
    Posted 10 years ago #

    Jaqueline: That's what I was trying to do, but when I type the form in to the the "Write Page" form and then view the page, there is no form. The code completely diappears, except for the labels that are outside of the form entry tags.

    mdawaffe: Yeah. I guess that's what I'll do, but I need to figure out how to call the page by a name rather than an id number. It would make more sense for the long-term.

  5. moshu
    Posted 10 years ago #

    scruffy, you can call "by name" only if you have permalinks working.

  6. Jaqueline
    Posted 10 years ago #

    Scruffy, it´s so strange how WP can behave in different ways! LOL
    To me, th form like this just works really fine!

  7. davincim
    Posted 10 years ago #

    scruffy - what kind of form are you trying to create? Something like a contact form? If so, have you tried the WP-Contact plugin?


  8. scruffy
    Posted 10 years ago #

    As it happens, I am, in fact trying to put in a contact form. Really, just using the plain ol' mail cgi script from my provider.

    The code I'm entering is:

    <form action="http://the.ip.address/cgi-bin/nmail.pl" method="POST">
    <input type="hidden" name="to" value="myemailaddress@gmail.com" />
    <input type="hidden" name="redir" value="http://www.daddyzine.com/test/?page_id=11" />
    <input type="text" name="subject" value="subject of the email" />
    Email: <input type="text" name="email" value="email address "/>
    Message: <input type="text" name="message"/>
    <input type="submit" name="submit" value="Send"/></form>

    (obviously the ip address and email address have been change dto their appropriate values)

    You can see the results here:


    It's the damnedest thing, really. And whereas, I will probably use that script, I'd really like to figure out why I can't seem to post *any* code at all. For example... see the word "blah" after the post?, well... that was inserted in the Write Page interface in a div tag with an id of "blah," *but* if you look at the code, you can see that it's now in a p tag.

  9. scruffy
    Posted 10 years ago #

    Okay... apparently this is some problem with my theme. I switched back to kubrick and everything was right where it was supposed to be.

    WTF have I done???

    Crap. Now I have to figure this out.

    Anyone have any ideas of what I might have left out, or inadvertently put *in* that could cause this?

  10. davincim
    Posted 10 years ago #

    scruffy, if all you're trying to do is make a contact form, I encourage you to give WP-Contact a try. It would be a lot simpler. Just my two cents. :)

  11. scruffy
    Posted 10 years ago #

    I figured it out :)

    In my index.php page, I was calling the_excerpt rather than the_content. the_excerpt strips out all html. It took awhile to figure it, but then it was one of those ah-ha moments. I changed it, and it works.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.