Hi Fellaz!
It’s me once again…
If i just have a single value everything works great.
The input field keeps the value after submitting the form.
<div class="form-group row">
<label for="highlight" class="col-12 col-sm-10 col-form-label">
<?php echo $section->formHighlightName(); ?> <span class="price"><?php echo $section->formHighlightPrice(); ?></span>
</label><!-- /.col -->
<div class="col-sm-2">
<input placeholder="g" class="form-control" name="highlight" id="highlight" type="number" value="<?php echo $form->old('highlight') ?>">
</div><!-- /.col -->
</div><!-- /.form-group row -->
Now i’m trying to keep the values in this scenario (array).
<?php $items = $section->formProducts()->toStructure(); ?>
<?php foreach ($items as $item): ?>
<div class="form-group row">
<label for="<?php echo $item->formProductName()->slug(); ?>" class="col-12 col-sm-10 col-form-label">
<?php echo $item->formProductName(); ?> <span class="price"><?php echo $item->formProductPrice(); ?></span>
</label><!-- /.col -->
<div class="col-sm-2">
<input placeholder="g" class="form-control" name="products[<?php echo $item->formProductName(); ?>]" id="<?php echo $item->formProductName()->slug(); ?>" type="number" value="<?php echo $form->old('$item->formProductName()->slug()') ?>">
</div><!-- /.col -->
</div><!-- /.form-group row -->
<?php endforeach; ?>
Somehow i think my question is related to this topic:
I tried to adapt the code for my case but without any luck. ;-(
Any help would be greatly appreciated!
Saludos, Funkybrotha