WordPress Inserting Line Breaks In Front of Form Elements

Filed Under Geek, Wordpress on 2009-02-26, 13:37

So I’m working on a form for users to submit data on a WordPress-based site. I want it to look like this:

correct_form

What I’m getting is this:

wrong_form

Those are screenshots, so here’s a “live” example:
Name:
Email:
Phone #:

Taking a look at the preview page using Firebug, I noticed that it was inserting <br /> in front of each input field. It did this with a select drop-down menu too. What gives? Anyone ever run into this?


Comments

  • Aron

    I dont know how this works in wordpress but in HTML you should be using <label> elements instead of plain text descriptions.

  • sergiozambrano

    I'm using label tags, and wordpress STILL adds a br before the input button!
    The formatting of the button depends on label's background and it's broken.
    How do I prevent that other than manually editing the database?

  • http://www.nookdigital.com duncanmoo

    I hope you found a solution for this by now, but on the WP forums there was a nice little solution: http://wordpress.org/support/topic/240350

    Basically using styles to ignore any br within the form section, nice but a bit hacky :)

  • duncanmoo

    I hope you found a solution for this by now, but on the WP forums there was a nice little solution: http://wordpress.org/support/topic/240350

    Basically using styles to ignore any
    's within the form section, nice but a bit hacky :)