PDA

View Full Version : combo inside <p>



frankly
8 Apr 2007, 12:17 PM
Hi,

I tested the combo boxes inside an already running app and couldn't figure out why it didn't display in IE, for the "transform a select".
got a message "HTML source not valid for this operation" in that case :

<p>
<select id="state" name="state">
</select>
</p>

and it works with this :

<select id="state" name="state">
</select>

JS is only with the example given :

var box_states = new Ext.form.ComboBox({
typeAhead: true,
triggerAction: 'all',
transform:'state',
forceSelection:true
});

There are also some issues with the margins, as well as a clear statement that I didn't find, that prevent me from using <label> in front of the select.

Already seen all these or not?

Thanks

jack.slocum
8 Apr 2007, 3:57 PM
A <p> can only hold inline elements. The combo is wrapped in a div, which is a block element. That is the same reason it doesn't work inline beside a standard label. Uising float or other CSS form styles (including the ones included with Ext) should make it easy to work around.

frankly
8 Apr 2007, 9:28 PM
I tried to understand why, but the explanation is not completely clear.
Actually, when you have a form, You have to put something like a <p> inside it to get xhtml validation right? So if you can't put a form around the <select> I think there might be a problem in it.

So if your object is not displayed because of this, only for IE, that's quite a weird stuff.
It displays correctly inside FF anyway, without any warnings, so there might be something else.

For the <label> should be ok, we'll find something to work around I think.

Thanks for the help

JeffHowden
8 Apr 2007, 10:02 PM
Actually, when you have a form, You have to put something like a <p> inside it to get xhtml validation right?

No, not true at all. In fact, using a <p> for anything other than displaying a paragraph is semantically incorrect.


So if your object is not displayed because of this, only for IE, that's quite a weird stuff. It displays correctly inside FF anyway, without any warnings, so there might be something else.

Actually, if FF isn't throwing any warnings, then either they're disabled, FF is clearly in the wrong, or there's something up with the DOCTYPE (or lack thereof) of your HTML document.