My choice of fieldname for CakePHP's form helper is not working properly, why?

Posted by grokker on Stack Overflow See other posts from Stack Overflow or by grokker
Published on 2010-03-31T07:43:01Z Indexed on 2010/03/31 7:43 UTC
Read the original article Hit count: 157

Filed under:
|

Hi, I'm creating an AJAX form. The problem is when I'm trying to create a input form with formhelper, my input's name attribute is not correctly renedered in the view. Here's my code:

$form->input('MainAttribute.'.$i.'.SubAttribute.'.$j.'.score', array('label' => '', 'options' => $scores));

I created it that way because I want SubAttribute to be inside MainAttribute. When I inspect the HTML, the name attribute of the form is cutted of like:

name="data[SuperMainAttribute]"

How can I specify the name attribute to the one that I'm planning on doing? (e.g. data[MainAttribute][0][SubAttribute][0][score])

© Stack Overflow or respective owner

Related posts about cakephp

Related posts about php