0

I don't know what causing problem. I have a form with two field call name and category.

    ->add('name', 'text')
    ->add('category','choice', array(
         'choices' => $options['categories']
    ))

this categroy is a choice list. So here i have a problem, Once i submit this form. I don't get any value of category

but when i change the datatype of category

->add('name', 'text')
->add('category','text')

then i can see the printed array of getData function.

Please help!!! where am i wrong?

FYI, Symfony version 2.5.4 and db engine is innodb with Fk on category.

[EDIT 1]
As i am submitting the form by ajax request and using rest api.

my function call for submitting the form is

$form->submit($parameters, 'PATCH' !== $method);

After submitting i can see only name not category in the printed object.

Code
  • 1,574
  • 2
  • 23
  • 37
  • Are you getting no value at all or an integer? – qooplmao Jun 13 '15 at 09:57
  • It seems to me, that you are searching the entity field type (http://symfony.com/doc/current/reference/forms/types/entity.html)? But it's hard to say without more information. – skroczek Jun 13 '15 at 10:04
  • I am getting no value. Actually i am using submit function to manually submit. I will updated the question – Code Jun 13 '15 at 10:20

0 Answers0