F
Filamentlazydog

Multiple Field in Custom Field

Hi, pls help. How can I handle or get the 2 values from a custom field?
Solution:
I've used KeyValue instead and made some customization. Thanks for your time 🙂
No description
V
Vp12d ago
using wire:model
L
lazydog12d ago
Like this? Upon submission, I can't read that field. Just the custom filed but has null value
No description
L
lazydog12d ago
Im using Filament Form Field (Custom Field)
V
Vp12d ago
Really? but your <input ... doesn't look like filament form field.
L
lazydog12d ago
Yeah, that's why I ask because I don't know how to do it using 2 fields in 1 custom form field. Above code is just an example.
L
lazydog12d ago
No description
V
Vp12d ago
then why not provide some code to check for.. I answer you by guessing only...
L
lazydog12d ago
My fault, I've screenshot it
V
Vp12d ago
Don't.. read #✅┊rules to format code
L
lazydog12d ago
@php
$statePath = $getStatePath();
$state = $getState();
@endphp

<x-dynamic-component
:component="$getFieldWrapperView()"
:field="$field"
>
<div>
<div class="sm:flex rounded-lg shadow-sm">
<input wire:model="inputName1"
class="fi-input pe-11 block w-full border-gray-200 sm:shadow-sm -mt-px -ms-px first:rounded-t-lg last:rounded-b-lg sm:first:rounded-s-lg sm:mt-0 sm:first:ms-0 sm:first:rounded-se-none sm:last:rounded-es-none sm:last:rounded-e-lg text-sm relative focus:z-10 focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-slate-900 dark:border-gray-700 dark:text-gray-400 dark:focus:ring-gray-600"
>
<input wire:model="inputName2"
class="fi-input pe-11 block w-full border-gray-200 sm:shadow-sm -mt-px -ms-px first:rounded-t-lg last:rounded-b-lg sm:first:rounded-s-lg sm:mt-0 sm:first:ms-0 sm:first:rounded-se-none sm:last:rounded-es-none sm:last:rounded-e-lg text-sm relative focus:z-10 focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-slate-900 dark:border-gray-700 dark:text-gray-400 dark:focus:ring-gray-600"
>
</div>
</div>
</x-dynamic-component>
@php
$statePath = $getStatePath();
$state = $getState();
@endphp

<x-dynamic-component
:component="$getFieldWrapperView()"
:field="$field"
>
<div>
<div class="sm:flex rounded-lg shadow-sm">
<input wire:model="inputName1"
class="fi-input pe-11 block w-full border-gray-200 sm:shadow-sm -mt-px -ms-px first:rounded-t-lg last:rounded-b-lg sm:first:rounded-s-lg sm:mt-0 sm:first:ms-0 sm:first:rounded-se-none sm:last:rounded-es-none sm:last:rounded-e-lg text-sm relative focus:z-10 focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-slate-900 dark:border-gray-700 dark:text-gray-400 dark:focus:ring-gray-600"
>
<input wire:model="inputName2"
class="fi-input pe-11 block w-full border-gray-200 sm:shadow-sm -mt-px -ms-px first:rounded-t-lg last:rounded-b-lg sm:first:rounded-s-lg sm:mt-0 sm:first:ms-0 sm:first:rounded-se-none sm:last:rounded-es-none sm:last:rounded-e-lg text-sm relative focus:z-10 focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-slate-900 dark:border-gray-700 dark:text-gray-400 dark:focus:ring-gray-600"
>
</div>
</div>
</x-dynamic-component>
I need to read and get the values from 2 input fields
V
Vp12d ago
Did you define in your components?
L
lazydog12d ago
Define meaning this?
php artisan make:form-field CustomField
php artisan make:form-field CustomField
I've ran that command and add html codes from created views Used CustomField::make() to my resource
Solution
L
lazydog12d ago
I've used KeyValue instead and made some customization. Thanks for your time 🙂
Want results from more Discord servers?
Add your server
More Posts
How to make table groups have a specific order?For example, I'm grouping by status but i would like the groups to be listed in a specific order. NoAdd Alpine Collapse plugin to dashboardI've tried a few methods of adding the script tag for enabling the collapse alpine plugin (https://aGroup resource list without model IDI'm trying to create a page that will bring the records of Student Certificates from the group groupOnly one collapsible element expanded at a timeI'm using the section blade component. When a user clicks on one element, I want it to expand, and cUnhandled match case '...'Its caused by ``` <x-filament::icon-button icon="heroicon-o-user-circle" size="w-12 h-12" label="NeBranding a panel with tenant infoI was hoping to use a tenants name, logo, color, etc for the branding of a panel but the tenant hasnEnable Echo.js without breaking Hot ReloadOk I'm at my wit's end here... I know this is probably not strictly Filament related, but maybe therTextEntry when value is null```php TextEntry::make('strap') ->columnSpanFullfilament tabs from blade dont have contentHow can I add content to the tabs directly from blade? As it is now, Its just the tab items themselvHow do I make the bar chart widget to take the full height here?Listener on *resource* (not page)I know listeners on Pages are easy enough - but I can't get them to work on a resource. Essentially Why is this bad? Sending export completion notification to the UI as well as to the database.I played around with the built in filament/packages/actions/src/Exports/Jobs/ExportCompletion.php haCall $livewire->js in header actions?I have this table action which just opens a link with a token, it uses the livewire component to exesticky table headerHello, I've searched this question here and all the solutions did not work, they did do something buDateTimePicker not working hourFormat propertyI'm trying to develop my page with a DateTimePicker able to switch between AM/PM hours, a 12hr formaHow to get data from custom Livewire component that is part of form?I have this Livewire component in my form in an action. How can I get data from that Livewire componRelationManager table action not workingIn a `RelationManager`, the following action works as a header action, but not as a row action. ClicUnderstanding the DatabaseNotificationsSent event. Not seeing websocket notifications in admin panelI have Echo and Soketi running for real time notifications, where I want to dispatch filaments builtHow to enforce client loads newest theme.css?We build the theme CSS on each deploy. How can we tell clients to ignore local cache, and load the nWhat to use: Repeater or Key-valueI have checked the docs of both repeater and key-value form builder fields. I liked both. I am conf