PHP code example of ogroosoft / onchange-load-dependant-field-data
1. Go to this page and download the library: Download ogroosoft/onchange-load-dependant-field-data library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ogroosoft / onchange-load-dependant-field-data example snippets
CRUD::addField([
'view_namespace' => 'ogroosoft-onchange-field-options::fields',
'type' => "dependantFieldOptions",
'dependency_name' => 'surah_id', // write (parent/specefic) field name, when the field's value will change then load this field options
'label' => "Verse",
'name' => 'verse_id',
'source' => route('surah.verses'),
'attribute' => 'verse_no', // option's key name for showing option label
// 'source_method' => 'post', // by default post
// 'id' => 'field_id',
// 'placeholder' => 'placeholder', // by default "-"
// 'hint' => 'hint',
]);