Replies: 3 comments 2 replies
-
i am searching for a while too. |
Beta Was this translation helpful? Give feedback.
-
It can be achieved using Listener. Though it is not as flexible as using JS, it does the trick for me. This is from Orchid's Listener documentation page :
|
Beta Was this translation helpful? Give feedback.
-
extend std input field like; namespace App\Orchid\Fields;
class CustomInput extends \Orchid\Screen\Fields\Input
{
public function __construct(){
$this->inlineAttributes[] = 'onclick';
$this->inlineAttributes[] = 'onchange';//onblur, onfocus, etc..
parent::__construct();
}
} Then set it where you use, $input->onchange("console.log('onchange works') "); |
Beta Was this translation helpful? Give feedback.
-
I am not much familiar with orchid so I am using Orchid Crud to implement a basic crud form for a model having only id, name, slug and timestamp columns. For the slug column, I want to generate it using javascript from the value of name field when user types in some text. You can see, this is a pretty simple need of adding an onchange event on an input box in a screen. But I couldn't find anything to accomplish this in the documentation. Can someone help me on this?
Beta Was this translation helpful? Give feedback.
All reactions