Re: Putting a label on same line as an input field
Well I finally cracked this myself - it is due to the infamous IE6 float margin bug What I do is: CSS: label { padding-left: 10px; padding-right: 1px; } .idbox { float: left; background:#ffc; } Cake Code: echo $form->input('idcode', array('label'=> $lb,'type'=>'text','length'=>2,'maxlength'=>2, 'div'=>'idbox') ); The only caveat is that all the field labels are on the left (which is fine...) and it's a) simple and b) works in all browsers I tested today (Safari, FF3 (Ubuntu, XP), Konqueror (Ubuntu) and IE6, IE8 (XP) Danny On Ap r 10, 12:02 am, Danny Lieberman wrote: > Dardo > > Thanks - I already tried this direction and it doesn't affect the > location of the label - it still appears above the input box. > > I can change label placement for all the forms but in this case I only > want to change one particular field label > > In the view: > > echo $form->input('idcode', array('label'=>'Patient ID > Code','type'=>'text','length'=>2,'maxlength'=>2, 'div' =>array('id' => > 'left-label')) ); > > and this is what I have in the css > left-label { float: left; width: 100px; display: block; } > > label { > display: block; > font-size: 110%; > padding-right: 20px;} > > input, textarea { > clear: both; > font-size: 140%; > font-family: "frutiger linotype", "lucida grande", "verdana", sans- > serif; > padding: 2px; > > Danny > > On Apr 8, 5:59 pm, Dardo Sordi Bogado wrote: > > > > Wouldn't you want all labels in side a form to appear on the left? > > > Perhaps I misunderstand the question, I thought he was asking how to > > set an specific label in the left side. > > > > If so then why not do something along the lines of > > > label { > > > float: left; > > > width: 75px; > > > display: block; > > > clear: left; > > > text-align: left; > > > cursor: hand; > > > } > > > In that case is better not to clear the labels, so ther don't affect > > floating divs. I prefer to simply float them, and set overflow:auto to > > de wrapping divs: > > > label { float: left; width: 75px; display: block; } > > .input { overflow: auto; } > > > Regards, > > - Dardo. > > > > On Apr 8, 6:31 am, Dardo Sordi Bogado wrote: > > >> Assign some specific css selector (setting an id or class in the > > >> wrapping div should work), then set label { display: inline } or float > > >> the things left... > > > >> $form->input('lefty-input', array('div' =>array('id' => > > >> 'make-me-left'))); > > > >> HTH, > > >> - Dardo > > > >> On Wed, Apr 8, 2009 at 8:26 AM, Danny Lieberman > > >> wrote: > > > >> > This is sort of a classic css question but I have not been able to > > >> > position an label on the left side of an input field - it always > > >> > slides to the top. When I did get the label on the left-it impacted > > >> > the layout of the entire form. > > > >> > br > > >> > Danny --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Putting a label on same line as an input field
Well I finally gave up and put all the labels on left hand side of the imput fields - i made a little class called xg with a background in order to emphasize the field in question works nicely in Firefox and Konqueror label { float: left; width: 150px; display: block; clear: none; text-align: left; vertical-align: middle; padding-right: 0px;} .xg { display: block; background:#ffc; float:left; } You can override the wrapping div in the $form->input like this: echo $form->input('idcode', array('label'=> $lb,'type'=>'text','length'=>2,'maxlength'=>2,'div'=>'xg') ); BUT it doesn't work in IE6 :-( Danny On Apr 10, 12:02 am, Danny Lieberman wrote: > Dardo > > Thanks - I already tried this direction and it doesn't affect the > location of the label - it still appears above the input box. > > I can change label placement for all the forms but in this case I only > want to change one particular field label > > In the view: > > echo $form->input('idcode', array('label'=>'Patient ID > Code','type'=>'text','length'=>2,'maxlength'=>2, 'div' =>array('id' => > 'left-label')) ); > > and this is what I have in the css > left-label { float: left; width: 100px; display: block; } > > label { > display: block; > font-size: 110%; > padding-right: 20px;} > > input, textarea { > clear: both; > font-size: 140%; > font-family: "frutiger linotype", "lucida grande", "verdana", sans- > serif; > padding: 2px; > > Danny > > On Apr 8, 5:59 pm, Dardo Sordi Bogado wrote: > > > > Wouldn't you want all labels in side a form to appear on the left? > > > Perhaps I misunderstand the question, I thought he was asking how to > > set an specific label in the left side. > > > > If so then why not do something along the lines of > > > label { > > > float: left; > > > width: 75px; > > > display: block; > > > clear: left; > > > text-align: left; > > > cursor: hand; > > > } > > > In that case is better not to clear the labels, so ther don't affect > > floating divs. I prefer to simply float them, and set overflow:auto to > > de wrapping divs: > > > label { float: left; width: 75px; display: block; } > > .input { overflow: auto; } > > > Regards, > > - Dardo. > > > > On Apr 8, 6:31 am, Dardo Sordi Bogado wrote: > > >> Assign some specific css selector (setting an id or class in the > > >> wrapping div should work), then set label { display: inline } or float > > >> the things left... > > > >> $form->input('lefty-input', array('div' =>array('id' => > > >> 'make-me-left'))); > > > >> HTH, > > >> - Dardo > > > >> On Wed, Apr 8, 2009 at 8:26 AM, Danny Lieberman > > >> wrote: > > > >> > This is sort of a classic css question but I have not been able to > > >> > position an label on the left side of an input field - it always > > >> > slides to the top. When I did get the label on the left-it impacted > > >> > the layout of the entire form. > > > >> > br > > >> > Danny --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Putting a label on same line as an input field
Dardo Thanks - I already tried this direction and it doesn't affect the location of the label - it still appears above the input box. I can change label placement for all the forms but in this case I only want to change one particular field label In the view: echo $form->input('idcode', array('label'=>'Patient ID Code','type'=>'text','length'=>2,'maxlength'=>2, 'div' =>array('id' => 'left-label')) ); and this is what I have in the css left-label { float: left; width: 100px; display: block; } label { display: block; font-size: 110%; padding-right: 20px; } input, textarea { clear: both; font-size: 140%; font-family: "frutiger linotype", "lucida grande", "verdana", sans- serif; padding: 2px; Danny On Apr 8, 5:59 pm, Dardo Sordi Bogado wrote: > > Wouldn't you want all labels in side a form to appear on the left? > > Perhaps I misunderstand the question, I thought he was asking how to > set an specific label in the left side. > > > If so then why not do something along the lines of > > label { > > float: left; > > width: 75px; > > display: block; > > clear: left; > > text-align: left; > > cursor: hand; > > } > > In that case is better not to clear the labels, so ther don't affect > floating divs. I prefer to simply float them, and set overflow:auto to > de wrapping divs: > > label { float: left; width: 75px; display: block; } > .input { overflow: auto; } > > Regards, > - Dardo. > > > On Apr 8, 6:31 am, Dardo Sordi Bogado wrote: > >> Assign some specific css selector (setting an id or class in the > >> wrapping div should work), then set label { display: inline } or float > >> the things left... > > >> $form->input('lefty-input', array('div' =>array('id' => 'make-me-left'))); > > >> HTH, > >> - Dardo > > >> On Wed, Apr 8, 2009 at 8:26 AM, Danny Lieberman wrote: > > >> > This is sort of a classic css question but I have not been able to > >> > position an label on the left side of an input field - it always > >> > slides to the top. When I did get the label on the left-it impacted > >> > the layout of the entire form. > > >> > br > >> > Danny --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Putting a label on same line as an input field
> Wouldn't you want all labels in side a form to appear on the left? Perhaps I misunderstand the question, I thought he was asking how to set an specific label in the left side. > If so then why not do something along the lines of > label { > float: left; > width: 75px; > display: block; > clear: left; > text-align: left; > cursor: hand; > } In that case is better not to clear the labels, so ther don't affect floating divs. I prefer to simply float them, and set overflow:auto to de wrapping divs: label { float: left; width: 75px; display: block; } .input { overflow: auto; } Regards, - Dardo. > On Apr 8, 6:31 am, Dardo Sordi Bogado wrote: >> Assign some specific css selector (setting an id or class in the >> wrapping div should work), then set label { display: inline } or float >> the things left... >> >> $form->input('lefty-input', array('div' =>array('id' => 'make-me-left'))); >> >> HTH, >> - Dardo >> >> On Wed, Apr 8, 2009 at 8:26 AM, Danny Lieberman wrote: >> >> > This is sort of a classic css question but I have not been able to >> > position an label on the left side of an input field - it always >> > slides to the top. When I did get the label on the left-it impacted >> > the layout of the entire form. >> >> > br >> > Danny > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Putting a label on same line as an input field
Wouldn't you want all labels in side a form to appear on the left? If so then why not do something along the lines of label { float: left; width: 75px; display: block; clear: left; text-align: left; cursor: hand; } On Apr 8, 6:31 am, Dardo Sordi Bogado wrote: > Assign some specific css selector (setting an id or class in the > wrapping div should work), then set label { display: inline } or float > the things left... > > $form->input('lefty-input', array('div' =>array('id' => 'make-me-left'))); > > HTH, > - Dardo > > On Wed, Apr 8, 2009 at 8:26 AM, Danny Lieberman wrote: > > > This is sort of a classic css question but I have not been able to > > position an label on the left side of an input field - it always > > slides to the top. When I did get the label on the left-it impacted > > the layout of the entire form. > > > br > > Danny --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Putting a label on same line as an input field
Assign some specific css selector (setting an id or class in the wrapping div should work), then set label { display: inline } or float the things left... $form->input('lefty-input', array('div' =>array('id' => 'make-me-left'))); HTH, - Dardo On Wed, Apr 8, 2009 at 8:26 AM, Danny Lieberman wrote: > > This is sort of a classic css question but I have not been able to > position an label on the left side of an input field - it always > slides to the top. When I did get the label on the left-it impacted > the layout of the entire form. > > br > Danny > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---