Dynamic form not sending all values
Dynamic form not sending all values
I have a form and I can add more dynamically by using Javascript, and that is working; but when I send the value to the controller I only get the data from the last filled form and have no idea why.
I am using laravel 5.4.
EDIT:
I'm putting the hole view code just in case there is something I am not seeing and maybe someone else will.
Thanks in advanced
{!! Form::open(array('route' => 'items.store', 'method' => 'POST'), array('role' => 'form')) !!}
{!! Form::label('cantidad', 'Cantidad') !!}
{!! Form::text('cantidad', null, array('placeholder' => 'Ingresa cantidad del item', 'class' => 'form-control')) !!}
{!! Form::label('detalle', 'Detalle') !!}
{!! Form::text('detalle', null, array('placeholder' => 'Ingresa detalle del artículo', 'class' => 'form-control')) !!}
{!! Form::label('unidad', 'Unidad') !!}
{!! Form::text('unidad', null, array('placeholder' => 'Ingresa la unidad de medida (cm, m, kg; etc)', 'class' => 'form-control')) !!}
{!! Form::label('unitario', 'Unitario') !!}
{!! Form::text('unitario', null, array('placeholder' => 'Indica el valor unitario del item', 'class' => 'form-control')) !!}
{!! Form::button('Guardar', array('type' => 'submit', 'class' => 'btn btn-primary')) !!}
{!! Form::close() !!}
How about you share some code? We can't solve the problems we can't see. Where do you preform the form submission?
– Matt Clark
Jul 3 at 3:49