Support the ongoing development of Laravel.io →
Laravel Blade
Last updated 1 year ago.
0

Hi, I do not see a problem here though,

From what I can understand is that the id always remains the same.

First, I would recommend you NOT to repeat the modal in a loop rather use a separate blade and include it in the code and use ajax to dynamically change the ids, values etc.

The button that calls the modal, you can bind an onclick event to call a function with $user->id as a parameter to set a hidden field in the form. Also $user->id can be used to get the current user data using ajax to fill the form fields. You should not have a problem there.

0

I think the issue is in your hidden field. <input class="form-control hidden" type="text" name="id" value="{{ $user->id }}" disabled>

You have defined this with the same name in a loop. At the end, you got the same value as the input name is "id" only. You can use <input class="form-control hidden" type="text" name="ids[]" value="{{ $user->id }}" disabled>

0

@Elsner Technologies right! How did i not see that??

0

Thanks all for the response, I fix it with solution from @Elsner Technologies

0

Pls Explain how you submit the form.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Devina shilohchis Joined 22 Jun 2017

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.

© 2024 Laravel.io - All rights reserved.