Re: Strange form helper output I can't understand: divs after input

2010-06-05 Thread Marcelo F Andrade
On Tue, May 18, 2010 at 8:48 PM, madcousinphil_  wrote:
> (..)
> 1st Question: What is with the very first input before the opening of
> the form? I don't think it is hurting, but why is it there?

Look at the opening form tag Cake creates for you.
Where the information about the method the form
uses came from?  The default method is post.  That hidden field is
only a control field Cake uses to retain this information internally
in the views
and in the rendered html code.

> 2nd question: You can see that the div which is supposed to be
> wrapping the input is actually output after the input, and is empty.
> eg:
>   div>
> This is a problem for me because I would like to use this to style the
> label and input field.  I can't understand what I did wrong. Has this
> happened to anyone before? How can I make it wrap the input like this
>  div>

I'm not sure, but I think this additional div is used
for validation messages.  You can omit it this way

echo $form->input('name', array('div' => false));

Best regards.

-- 
MARCELO F ANDRADE
Belem, Amazonia, Brazil

"I took the red pill"

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Strange form helper output I can't understand: divs after input

2010-05-19 Thread madcousinphil_
Please help me, I am a beginner.

I am using the form helper to create a form like this:

echo $form->create('Category');
echo $form->input('name');
echo $form->input('description', array('rows' => '3'));
echo $form->end('Save Category');

This works fine, but there are 2 parts of the html which bother me:



  Name
  
  
  Description
  
  
  
  


1st Question: What is with the very first input before the opening of
the form? I don't think it is hurting, but why is it there?

2nd question: You can see that the div which is supposed to be
wrapping the input is actually output after the input, and is empty.
eg:
 
This is a problem for me because I would like to use this to style the
label and input field.  I can't understand what I did wrong. Has this
happened to anyone before? How can I make it wrap the input like this


I checked in /cake/version.txt and it says I am using 1.2.6

Any help would make me very happy. Thanks in advance.

Phil

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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