Support » Fixing WordPress » Inserting a form on a Page

  • 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.

Viewing 10 replies - 1 through 10 (of 10 total)
  • 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=”” method=”POST”>
    <input type=hidden name=”recipient” value=””/>
    <input type=hidden name=”redirect” value=”″/>

    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:

    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.

    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.

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

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

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

    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/" method="POST">
    <input type="hidden" name="to" value="" />
    <input type="hidden" name="redir" value="" />
    <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.

    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?

    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. ๐Ÿ™‚

    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.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Inserting a form on a Page’ is closed to new replies.