how can i made textfields with the same name into form classes
- alnux
- Member | 139
hi there im trying to build a forms with same name textfields as array ex: mytextfield[], here is what is talking about
but tracy show me the next error
Nette\InvalidArgumentException
Component name must be non-empty alphanumeric string, ‘producto_id[]’ given
how can i made textfields with the same name into form classes, the
differences one from another will be the attr ‘id’, for templates
thanks for the help
Last edited by alnux (2017-05-14 17:31)
- duke
- Member | 650
You can't use names ending with [] for Nette form controls. You can however
use form containers and then end up having input names like
products[1][title]
, products[1][price]
,
products[2][title]
, products[2][price]
, etc.
Check Form::addContainer()
method.
If you insist on using the “[]” inputs, you still can, but instead of using Nette controls for them, you have to handle them via Form::getHttpData().
Last edited by duke (2017-05-14 19:25)