WordPress.org

Ready to get started?Download WordPress

Forums

WP auto adds <br> with form fields on same line (6 posts)

  1. gspark
    Member
    Posted 7 years ago #

    even in the page

    the label and input field are on the same line it addes a < br /> after the label

    is there anyway to stop this ?

    ie

    < label >< input > all on same line

    wordpress does it like this < label >< br />< input >

  2. kenneyjs
    Member
    Posted 6 years ago #

    I am having a problem with this as well. I try to enter a code with a $ <input> and it automatically puts the input on the next line. Anyone know of any solution to this?

  3. doug
    Member
    Posted 6 years ago #

    I was having the same problem. It looks like the bug will be fixed in version 2.4. It's a one-line patch, so you may be able to manually add it to your current installation.

    If you don't want to muck around with your source code, an easier fix is to put the label and input on consecutive lines, rather than the same line, like so:

    <label>...</label>
    <input ... />

    As described in a different bug, no <br/> will be added and they will appear on the same line in your web page (the line-break is treated as whitespace in the browser).

    Beware: the patch and the workaround may end up canceling each other out, resulting in a line-break reappearing if you ever install 2.4! I really don't know.

  4. amoswright
    Member
    Posted 6 years ago #

    Here is an option that works for me - Go into "code" view for your post, then give your form an id, like <form id="your_form_id" ... and then in your theme .css file add this css style:

    #your_form_id br { display:none;}

    It is perhaps less covenient because you have to give each form the id manually, but involves no patches (plus, I couldn't get the line break fix described here to work for me).

  5. dankelly613
    Member
    Posted 6 years ago #

    Just FYI... I tested both doug's <label> method and amoswright's ID method.

    doug's works in FF (v2.0.0.12), but not in IE6 (v6.0.2900).

    (IE6 adds a phantom </p> tag where the <br> used to be - making the problem worse.)

    amoswright's works in IE 6, but not in FF.

    Both techniques together (with a little twist) yield success.

    doug's <label> method: (thanks doug)

    put the label and input on consecutive lines, rather than the same line, like so:

    <label>...</label>
    <input ... />

    amoswright's UPDATED ID method:(thanks amoswright)

    #your_form_id p { display:none; }

    NOTICE THE "P" INSTEAD OF THE "BR".

    Thanks again guys!

  6. rhys
    Member
    Posted 6 years ago #

    Just got driven mad not solving this in 2.5.1, but found this post and had to use the -

    Text and Input on consecutive lines method and plus the p display:none to get both browsers conforming.

    All sweet now, but it the evil bug is still there obviously.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.