View Full Version : Form labels
Charles
8 Mar 2007, 2:21 PM
Does anyone have a tip for getting a <label> working with elements from Ext.form? I was able to try appending before date.wrap (I think that is what I was doing -- the wrapper element for the date) and was getting the label inserted correctly, but not without massive stylesheet issues.
tryanDLS
8 Mar 2007, 4:44 PM
This is still a work-in-progress. The new Form example has labels, but only when it's using existing HTML, I think. Not sure about the status for creating the label and the form element on the fly though.
Charles
8 Mar 2007, 5:38 PM
Something like this:
var d1 = new Ext.form.DateField();
d1.render('container');
d1.wrap.insertHtml('beforeBegin', '<label for="'+d1.el.id+'">Date</label>');
d1.wrap.setStyle({display: 'inline'});
Puts the label outside of the <div> that wraps the datefield and gets the label and the wrapper div in line together... but the element for d1.trigger is now visually way out of position.
Edit: Actually, I just noticed that on Firefox that worked beautifully... on Safari, however, it is a bit screwy for display.
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.