How to add default value in drodown in october cms?
Ad
On Fields.yaml file code is :
category:
label: Category
nameFrom: category_name
descriptionFrom: description
span: auto
type: relation
My controller code is :
public $belongsTo = [
'category' => [
'Ashish\Taeq\Models\RecipeCategory',
'conditions' => 'status = 1'
],
I need to set default category drop-down like "Please select category".
Ad
Answer
Ad
Please Use
emptyOption: " "
on On Fields.yaml
category:
label: Category
nameFrom: category_name
descriptionFrom: description
span: auto
type: relation
emptyOption: " "
Or Please follow below link : https://octobercms.com/forum/post/filtering-form-fields-with-dependson-problem
Ad
source: stackoverflow.com
Related Questions
Ad
- → October CMS Custom Mail Layout
- → How to register middlewares in OctoberCMS plugin?
- → How to add default value in drodown in october cms?
- → Redirect wrong url laravel 5.1
- → laravel blade templating error
- → Get environment value in controller
- → After copying Laravel from one PC to another it shows a strange error from helpers.php
- → Laravel 5.1 page authentication using routes
- → Trait 'IlluminateFoundationBusDispatchesJobs' not found
- → How to fix error while installing Laravel first time?
- → How to eager load and query a pivot table using Eloquent - Laravel 5
- → Any advantages of adding an id column to a pivot table in Laravel?
- → Laravel 5 Cashier Middleware Routing Error
Ad