7 Mar 2007 1:02 PM #1
Newline equivilent in Ext.MessageBox.alert()
7 Mar 2007 1:21 PM #2
It's writing to innerHTML, so you can embed HTML elements. I justed tested with both
and [b] and it works correctly.
7 Mar 2007 1:27 PM #3
Yes, it is writing as innerHTML, however, it's also writing that inside a <span> tag, as opposed to a <div>. Since a span tag is supposed to be an inline only tag, you can't pass anything inside it that isn't also inline, such as a
tag or a <ul> - both of which is what I would like to do.
8 Mar 2007 11:38 AM #4
Anyone? It would be nice to have HTML inside of the alert.
8 Mar 2007 11:49 AM #5
HTML is allowed inside the alert. I just updated the example to include
tags inside one of the messages and it appropriately split the text onto multiple lines.
8 Mar 2007 12:12 PM #6
Ok, let me rephrase then. The text that you specify to go into the alert gets pushed as innerHTML on a <span> tag. The <span> tag can only contain other inline elements like <abbr>, [b], or
. So, I can't put any block-level html elements, such as
or <ul> inside it.
8 Mar 2007 2:27 PM #7
err... obviously you can, but you don't want to because span isn't supposed to have any block level elements inside it, right?
I've always wondered about that... If you specify display of a span to be block (which is legitimate) are you supposed to treat it as inline or block in terms of allowed nesting elements? Can it still go inside another inline element?
Why not another span with a style to display as block? Or list item?
8 Mar 2007 3:29 PM #8
Well, in terms of valid code, I see your point Joker. However, as this as all generated on the fly, I hardly see the point. If it works, what's the worry?
To answer your question Charles, I don't think that setting display to block changes the rules about what can be placed inside an inline tag. Rather, I think it only affects the actual behavior of the element.
14 Dec 2009 12:24 PM #9
I know this thread is old, but I am running into the same problem with Ext.messageBox. Can someone post code to show this working. <abbr> did not work for me.
9 Apr 2010 3:54 AM #10
A little bit thread-ressurection:
I tested <br /> and it works fine in all 4 major browser, tough it might not comply some HTML standards. I use it only for specific error messages, so I don't mind standards
By INeedADip in forum Ext 2.x: Help & DiscussionReplies: 7Last Post: 11 May 2007, 12:51 PM
By minoan in forum Ext 1.x: Help & DiscussionReplies: 4Last Post: 20 Mar 2007, 11:44 AM
By cebola in forum Ext 1.x: Help & DiscussionReplies: 2Last Post: 13 Mar 2007, 5:25 AM
By Timoshka in forum Ext 1.x: Help & DiscussionReplies: 3Last Post: 29 Dec 2006, 11:52 AM
By email@example.com in forum Ext 1.x: Help & DiscussionReplies: 13Last Post: 9 Dec 2006, 12:28 PM