2

I'm developing an application using Symfony2 and Elasticsearch. To communicate the ORM-way I use the Ongr ElasticsearchBundle (https://github.com/ongr-io/ElasticsearchBundle).

In my project I have a page which displays data in a table. The user should be able to filter this data. So I made a form (without entities) containing a formcollection. A FormType can be added (several times) to this collection using Javascript. This FormType contains a textfield and a dropdown. The dropdown is filled with all possible fields for the particular Elasticsearch document (comparable to a Doctrine entity). So, the user chooses a field from the dropdown and this field should match the value in the textfield.

This actually works, but I try to find a way to validate this. The value is filled in in a textfield, so the form is always valid. But some fields should be integers or dates.

Mantas
  • 4,259
  • 2
  • 27
  • 32

0 Answers0