Support the ongoing development of Laravel.io →
Input Forms Testing
Last updated 9 months ago.
0

txtjandatum, txtjanactiviteit, txtjanwaar and txtjanuur fields' names should be like txtjandatum[] ... This makes input field an array. Then Input::get('txtjandatum') will return an array contains all txtjandatum values by row order.

Last updated 9 months ago.
0

@mgmus

Thanks for the reply. Then how should those fields be named :

txtjandatum[] OR txtjandatum$i[] ($i representing the number)

and do i use the 'get' in the same file as the input fields or in the next one?

Last updated 9 months ago.
0
Solution

Just txtjandatum[]. Default array index will give you the row number. (Starts with zero)

$jandatum = Input::get('txtjandatum');

// $jandatum[0] returns value of the field in first row
// $jandatum[1] returns value of the field in second row
// ...

foreach($jandatum as $rowNumber => $inputValue) {
    // do something with $rowNumber and $inputValue
}
Last updated 9 months ago.
0

Thanks for the advice, I used your idea to use array's. It would't work, so i tweaked it a bit and now it does work! Thanks for the help ;-)

Last updated 9 months ago.
0

Sign in to participate in this thread!

Full Stack Europe

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2023 Laravel.io - All rights reserved.