© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
13 replies
freekdz

add input to form

Please how can add the input checkbox data in my state form
"I want to add the selected IDs to the state when I click the 'Add' button, in order to subsequently add all the forms to the table."
if ($isMultiline) {
Step::make('Disponibilites')
->schema([
Placeholder::make('')
->content(function () {
$disponibiliteRecords = Disponibilites::all();
echo '<table>';
echo '<tr>';
$count = 0;
foreach ($disponibiliteRecords as $disponibilite) {
echo '<td>';
echo '<p style="margin-right:130px;"></p>';
echo '<p style="margin-bottom:20px;"></p>';
echo '<p>'. $disponibilite->code .'</p>';
echo '<p><img src="' . asset('storage/uploads/'.$disponibilite->image) . '" alt="Image"></img></p>';
echo '<p>' . $disponibilite->commune_name . '</p>';
echo '<p>' . $disponibilite->adresse . '</p>';
echo '<input type="checkbox" data-id="' . $disponibilite->id . '">';
echo '</td>';
$count++;
if ($count % 3 === 0) {
echo '</tr><tr>'; // Nouvelle ligne après chaque 2e élément
}
}
// Fermer la dernière ligne si nécessaire
if ($count % 3 !== 0) {
echo '</tr>';
}
echo '</table>';
}),

Actions::make([
Action::make('Ajouter')
->icon('heroicon-m-x-mark')
->action(function (Set $set, $state) {
dd($state);
}),
]),
]);
}
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

How to connect input form
FilamentFFilament / ❓┊help
3y ago
Add form to list view
FilamentFFilament / ❓┊help
2y ago
add actions to form section
FilamentFFilament / ❓┊help
3y ago