I have a form in which I can add, in my case, order lines.
This is done with JQuery, cloning the entire line.
I use laravel 5.1 for the backend and for the client side I am occupying a JavaScript library of forms called parsley. At the time of validation by the server there is no problem, but at the time of doing it by client-side with parsley I can not make my elements can validate them separately.
I do not know if I can understand.
Attached photos to get an idea.
Add line code
$("#addRow").on("click",function(e){
e.preventDefault();
e.stopPropagation();
$("#tabla tr:last").clone().find("input, select").val('').each(function() {
}).end().appendTo("#tabla");
});
Form view code
{!!Form::open(['route'=>'venta.store', 'id'=>'forma','method'=>'POST','data-parsley-validate'=>'parsley-validate'])!!}
@include('venta.forms.venta')
{!!Form::close()!!}
input blade element
<td width="17%">
<input type="text" class="form-control" id="cantidad" name="vtcanp[]" required />
</td>
The problem is that when I generate more than one line and I want to validate these new lines and put some value, it still gives me problems that there is no value being that I add one as it appears in the photo I put. I hope you understand