WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#6451 closed defect (bug) (invalid)

In html form, WP adds (/p) instead of (br /)

Reported by: PozHonks Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.5
Component: General Keywords: html form rendering
Focuses: Cc:

Description

In a form, when there should be a line break, instead of
adding "<br />", WP adds "</p>". But
there is no beginning "<p>". So, the layout of the form is a mess! But,
I think it is a bit more complicated, sometimes there is a <br/ >
See picture here:
<http://demo21.ovh.com/5bfed4cf73c151b9fc0f6b5e71f4bc87P/?see=rendering-form-RC3.png>
After "name:" there should be a line break, the checkbox should be in
a new line, etc.

Excerpt of the genuine code displayed in the wordpress admin area
(with the good line breaks):


<form action="/cgi-bin/mail.cgi" method="post">
<label><strong>Name:</strong></label>
<input maxlength="80" name="name" size="40" type="text" /> * <span
style="color: #006633; font-size: small;">required</span>

<label><strong>E-mail:</strong></label>
<input maxlength="80" name="email" size="40" type="text" /> * <span
style="color: #006633; font-size: small;">required</span>

<input name="confirmation_message" type="checkbox" value="1"
/><strong>Receive a copy of this message to your e-mail
address</strong>.

<label><strong>Subject:</strong></label>
<input maxlength="80" name="subject" size="40" type="text" /> * <span
style="color: #006633; font-size: small;">required</span>

<label><strong>Message:</strong></label>
<textarea style="width:450px;" cols="55" rows="15" name="message"></textarea>

<input style="font-size:1.5em;" name="submit_form" type="submit"
value=" SEND IT " />
</form>

Now, the html code interpreted by WP 2.5 :


<form action="/cgi-bin/mail.cgi" method="post">
<label><strong>Name:</strong></label></p>
<input maxlength="80" name="name" size="40" type="text" /> * <span
style="color: #006633; font-size: small;">required</span></p>
<p><label><strong>E-mail:</strong></label></p>
<input maxlength="80" name="email" size="40" type="text" /> * <span
style="color: #006633; font-size: small;">required</span></p>
<input name="confirmation_message" type="checkbox" value="1"
/><strong>Receive a copy of this message to your e-mail
address</strong>.</p>

<p><label><strong>Subject:</strong></label></p>
<input maxlength="80" name="subject" size="40" type="text" /> * <span
style="color: #006633; font-size: small;">required</span></p>
<p><label><strong>Message:</strong></label><br />

<textarea style="width:450px;" cols="55" rows="15"
name="message"></textarea></p>
<input style="font-size:1.5em;" name="submit_form" type="submit"
value=" SEND IT " />
</form>

If some </p> after </label> are replaced by <br>, everything should be fine.

Using WP 2.5, Firefox 3.0b4, Mac 10.5.2.
Safari 3.1 displays a better result by fixing this bug, interpreting
the lonely </p> as a <br />, but the source code, is still wrong.

Attachments (1)

rendering-form-WP25.png (63.5 KB) - added by PozHonks 6 years ago.
rendering html form in WP 2,5

Download all attachments as: .zip

Change History (4)

PozHonks6 years ago

rendering html form in WP 2,5

comment:1 follow-up: azaozz6 years ago

  • Milestone 2.5.1 deleted
  • Resolution set to invalid
  • Status changed from new to closed

See #6449.

comment:2 in reply to: ↑ 1 ; follow-up: PozHonks6 years ago

  • Milestone set to 2.5.1
  • Resolution invalid deleted
  • Status changed from closed to reopened

It's to bad to close this ticket, because putting a lonely </p> instead of a <br />, I call it a bug, not an unsupported feature.

comment:3 in reply to: ↑ 2 westi6 years ago

  • Milestone 2.5.1 deleted
  • Resolution set to invalid
  • Status changed from reopened to closed

Replying to PozHonks:

It's to bad to close this ticket, because putting a lonely </p> instead of a <br />, I call it a bug, not an unsupported feature.

The point is that entering a form like that into the TinyMCE text area is not supported.

You would do much better to do it using a plugin which can add the relevant code to the post when output.

There are a number of contact form plugins which achieve this quite satisfactorily.

Note: See TracTickets for help on using tickets.