Re: 2 column layout for $form->input() ?
I'm using v 1.2 and wasn't able to use that method to get rid of the div's 'div'=>'' still created a div for me, and didn't include it inline. If you instead use this: 'div'=>false in the options array, no div is created. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 2 column layout for $form->input() ?
Cake has no solution for this. css and html however, do. Instead of using html->input, use the corresponding function that does not wrap the form elements in anything, such as html->select or html->text etc. Then, use your own css and html to get it to do what you want. On Aug 18, 5:20 am, Malcolm Krugger <[EMAIL PROTECTED]> wrote: > Whenever I user $form->input in templates invariably it outputs one > below the other > > How do I make a 2 column form using $form->input tags ? > > Malcolm --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 2 column layout for $form->input() ?
Here is a small example of a view file which shows one text box and 2 horizontal pull down menus in a form in a single horizontal line create('DataForm' );?> "; echo $form->input('numberone' , array('label' => false , 'type'=>'text','size' => '7', 'maxlength'=>'7' , 'div' => '' , 'error' => false)); echo $form->input('dropdown1' , array('label' => false, 'div' => '' , 'options' => array( 'option1' =>'option1', 'option2' =>'option2', 'option3' =>'option3', 'option4' =>'option4', ))); echo $form->input('dropdown2' , array('label' => false , 'div' => '', 'options' => array( 'option1' =>'option1', 'option2' =>'option2', 'option3' =>'option3', 'option4' =>'option4') )); echo ""; ?> error('numberone'); echo $form->error('dropdown1'); echo $form->error('dropdown2'); echo $form->end('Send'); ?> --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 2 column layout for $form->input() ?
Maybe this is a little late but perhaps it will save some other soul some trial and error. I'm using 1.2 branch so this may not work for 1.1. To change the default class name for the div that surrounds the input when using form helper use the options array like so: echo $form- >input('tst_input',array('div'=>array('class'=>'tst_input'))); which results in this being the output: Tst Input instead of this (the default if not using the options array): Tst Input The same goes for the label and the input class as well. All that is left for you then is to CSS-it to your hearts content... --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 2 column layout for $form->input() ?
I needed all 3 form elements to display in a single horizontal line and here is my view template create('Data');?> input('numeral' , array('label' => false , 'type'=>'text','size' => '4', 'maxlength'=>'4' , 'style' => 'float: left; width: 30%; display:inline;' , 'div'=>'')); echo $form->input('pulldown1' , array('label' => false , 'style' => 'float: left; width: 30%; display:inline;' , 'div'=>'')); echo $form->input('pulldown2' , array('label' => false , 'style' => 'float: left; width: 30%; display:inline;' , 'div'=>'')); ?> end('Submit');?> and it did not work It still displays one below the other Any suggestions would be greatly helpful indeed Malcolm --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 2 column layout for $form->input() ?
ok. thanks to both you and Lance. I've got your CSS book sitting on my lap... peterm --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 2 column layout for $form->input() ?
Lance is correct, this is a CSS issue and not specific to CakePHP. If you look at the HTML being spit out by a $form->input is: If you're doing type=radio, then it's just multiple label/input inside those DIVs. To make everything "horizontal", just make sure all the elements are display:inline. Now, the only problem is if you have too many options to fit on a line. Then you might get a line break where you don't want it. Unfortunately, I don't know of a solution for this other than to create your own form helper that overloads the original form helper. I've had to do this on a recent project and has worked well. On Tue, Aug 19, 2008 at 4:18 PM, peterm95018 <[EMAIL PROTECTED]> wrote: > > Lance, > > Perhaps you misunderstand the question. Let me restate. > > Is it possible to use $form->input with $options to present form > elements horizontally? Such that: > label:input label:input label:input <-- displayed in a "row" to be > space efficient > > If yes, can someone post an example? If no, can someone confirm that > this isn't possible "out of the box"? > > peterm > > > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 2 column layout for $form->input() ?
Lance, Perhaps you misunderstand the question. Let me restate. Is it possible to use $form->input with $options to present form elements horizontally? Such that: label:input label:input label:input <-- displayed in a "row" to be space efficient If yes, can someone post an example? If no, can someone confirm that this isn't possible "out of the box"? peterm --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 2 column layout for $form->input() ?
@peterm95018 and @Malcolm, how-to for CSS and HTML probably isn't an appropriate topic for the Cake group–unless of course you are having trouble getting the HTML output you want from the HTML helper, for example. A bit of Google searching will find you some great examples of form layout. From 4 years ago, PPK's examples still hold true: http://www.quirksmode.org/css/forms.html. If you want to have the basic code generated for you, use a tool like Wufoo (http:// wufoo.com/) to create a nice looking form, then export the CSS and HTML code using their tools. HTML Dog has a nice set of tutorials also: http://www.htmldog.com/guides/htmlbeginner/forms/, see the bottom of each tutorial for code samples. On Aug 18, 5:53 pm, peterm95018 <[EMAIL PROTECTED]> wrote: > Would it be possible for someone to post a short example? I've been > struggling with formatting a form layout all day. > > thank you, > > peterm --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 2 column layout for $form->input() ?
Would it be possible for someone to post a short example? I've been struggling with formatting a form layout all day. thank you, peterm --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 2 column layout for $form->input() ?
Options. 1. Each input is invariably encased in a DIV. Set a width to half that of the container, and then float:left. 2. Put half the inputs in one DIV and the other half in another DIV. Float the DIVs. 3. Create a table with two columns, put half the inputs in one cell and half the inputs in another cell. Don't float. I'd go with #1 or #2 depending on what your needs are and how critical it is that the form be filled in a specific order. (ie: left to right, top to bottom vs top to bottom, left to right) -Jonathan On Mon, Aug 18, 2008 at 8:20 AM, Malcolm Krugger <[EMAIL PROTECTED]> wrote: > > Whenever I user $form->input in templates invariably it outputs one > below the other > > How do I make a 2 column form using $form->input tags ? > > Malcolm --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
2 column layout for $form->input() ?
Whenever I user $form->input in templates invariably it outputs one below the other How do I make a 2 column form using $form->input tags ? Malcolm --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---