Bug in :textarea? #48
Replies: 3 comments
-
Google Group Date: Tue, 20 May 2014 08:17:26 -0700 On Monday, May 19, 2014 10:48:37 PM UTC-7, Dave Howell wrote:
I can't reproduce this. I don't think Forme is giving you that markup, as Thanks, |
Beta Was this translation helpful? Give feedback.
-
Google Group Date: Tue, 20 May 2014 14:13:25 -0700 On May 20, 2014, at 8:17 , Jeremy Evans [email protected] wrote: <textarea id='order_note' name='order[note]’> Hah. Are there any tools out there for working with HTML that don’t f**k up the actual markup? {test test experiment different browser test test} It’s REXML. That’s what’s rewriting Forme’s markup and screwing it up in the process. |
Beta Was this translation helpful? Give feedback.
-
Google Group Date: Tue, 20 May 2014 16:18:50 -0700 On May 20, 2014, at 14:13 , Dave Howell [email protected] wrote:
Ridiculous. Forme spits out <textarea blah=“blah></textarea> REXML insists on rewriting that as <textarea blah=‘blah’/>. I cannot find any mechanism to prevent it from collapsing empty children, nor any way to force it to eschew self-closing tags. Safari and Firefox both absolutely detest a self-closing <textarea/> They both eat armfuls of markup following, as they hunt for the missing </textarea> tag. I can trick (or perhaps smack along side the head) REXML into making the tag right if I add and empty string as a child to the text area. {roll eyes} REXML::Element.new(“textarea”).add_text(“”) However, since Forme’s creating it, and I haven’t (yet) added a .to_xml method to Forme, and I’m building my page as a REXML document, at the moment I have to add Forme’s output as a string, and when the string gets converted to an XML element, <textarea> gets collapsed. So, for now . . . .
(The <= operator is my own thing. It’s like <<, except that REXML’s << only works on other REXML objects. In this case element <= string becomes element.add_text(string). String.as_xml expects that the string is valid XML, and turns it into a REXML element with as little encoding as possible.) |
Beta Was this translation helpful? Give feedback.
-
Google Group Post: https://groups.google.com/g/ruby-forme/c/iY0lnTJHu0A
Google Group Date: Mon, 19 May 2014 22:48:37 -0700
Google Group Sender: [email protected]
I have a comments field called “note”, so I thought it’d be nice to make it a text area:
Forme gave me this:
Note that the textarea tag fails to close. As a result, the rest of the form became the contents of the text area. :/
Beta Was this translation helpful? Give feedback.
All reactions