WordPress.org

Make WordPress Core

Opened 11 years ago

Closed 10 years ago

#4605 closed defect (bug) (wontfix)

input tags misformatted

Reported by: jaddle Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.2.1
Component: General Keywords: has-patch 2nd-opinion formatting forms input br
Focuses: Cc:

Description

I tried creating a form in a page - but the formatting is not working properly.

When I enter, for example:

Your name: <input name="submittername" type="text"/><br />
Your E-mail address: <input name="submitteremail" type="text" />

wordpress then modifies it to look like this when you view the page:

name:<br />
<input name="submittername" type="text"/>
Your E-mail address:<br />
<input name="submitteremail" type="text" />

It's putting in a br tag before each input tag, and not putting them in where I actually made line breaks.

Note that the code is not actually being altered - if I edit it again, I see the original code I wrote. It's just when it's rendered for viewing the page that I get the modified version.

Also, I'm not using the visual editor at all - it's disabled in my profile - so I don't imagine it could be at fault here.

Attachments (1)

blockelements.patch (913 bytes) - added by hakre 11 years ago.
(x)html-block-elements-name cleanup and sort

Download all attachments as: .zip

Change History (9)

#1 @Otto42
11 years ago

  • Component changed from Administration to General

For some reason, "input" is part of the $allblocks list in wpautop() in formatting.php... Which is odd, because input is an inline element, not a block element. I think that input should be removed from that list.

#2 @foolswisdom
11 years ago

  • Milestone set to 2.4 (future)

#3 @hakre
11 years ago

Take a look here as well: http://trac.wordpress.org/ticket/4716

This seems to be related to this Issue in some kind and gives an additional insight in <br/> and form element related issues. (WP 2.2.2)

#4 @Otto42
11 years ago

hakre: No, this is unrelated to #4716.

#5 @hakre
11 years ago

But it might cause the Problem I was reporting there as well. I have now removed INPUT from that list and now this turns out very well in my reported problem.

<hr> should be removed there as well as <select> and <style>. additionally it would make sense to sort this alphabetically for a better overview.

I made a patch against current svn.

@hakre
11 years ago

(x)html-block-elements-name cleanup and sort

#6 @hakre
11 years ago

  • Keywords has-patch added

#7 @hakre
11 years ago

  • Keywords 2nd-opinion added

#8 @azaozz
10 years ago

  • Milestone 2.5 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Forms are best added in custom templates, not in the Post area. Templates can include any html, php, js, etc. and are much better suited for this.

Note: See TracTickets for help on using tickets.