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 div ?php echo $form-create('DataForm' );? fieldset legend?php __('Add Stuff');?/legend ?php echo div id=div5; 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 /div; ? /fieldset ?php echo $form-error('numberone'); echo $form-error('dropdown1'); echo $form-error('dropdown2'); echo $form-end('Send'); ? /div --~--~-~--~~~---~--~~ 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: div class=tst_inputlabel for=tstTstInputTst Input/ labelinput name=data[tst][tst_input] type=text value= id=tstTstInput / instead of this (the default if not using the options array): div class=input textlabel for=tstTstInputTst Input/ labelinput name=data[tst][tst_input] type=text value= id=tstTstInput //div 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 ?php echo $form-create('Data');? fieldset legend?php __('Add Data');?/legend ?php echo $form-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'='')); ? /fieldset ?php echo $form-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() ?
@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() ?
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 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: divlabelinput 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() ?
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() ?
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 -~--~~~~--~~--~--~---