This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
Hi, I have a little bit question about field dependencies on this doc http://octobercms.com/docs/backend/forms#field-dependencies
in that example, the fields type are dropdown. How to implement in the others field.
for example,
name:
label: Username
type: text
greeting:
label: Greeting
type: text
dependsOn: name
If I type 'Fibonacci' in field 'name' and then the 'greeting' will change to 'Hello, Fibonacci'
Thanks
I only know the Input preset converter which converts Text to slugs. I though for you requirements you have to write a short javascript.
Crazymodder said:
I only know the Input preset converter which converts Text to slugs. I though for you requirements you have to write a short javascript.
can you give a sample code?
May your try to add in your model?
public function filterFields($fields, $context = null)
{
if($fields->name->value != "") { $fields->greeting->value = "'Hello, ". $fields->name->value; }
}
1-8 of 8