You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/actions/docs/01-overview.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -519,7 +519,7 @@ TextInput::make('slug')
519
519
520
520
### Running JavaScript when an action is clicked
521
521
522
-
If you need a simple action that runs JavaScript directly in the browser without making a network request, you can use the `jsAction()` method. This is useful for simple interactions like updating form field values instantly:
522
+
If you need a simple action that runs JavaScript directly in the browser without making a network request, you can use the `actionJs()` method. This is useful for simple interactions like updating form field values instantly:
The JavaScript string has access to `$get()` and `$set()` utilities, which allow you to read and modify the state of form fields in the schema.
541
541
542
-
<UtilityInjectionset="actions"version="4.x">As well as allowing a static value, the `jsAction()` method also accepts a function to dynamically calculate it. You can inject various utilities into the function as parameters.</UtilityInjection>
542
+
<UtilityInjectionset="actions"version="4.x">As well as allowing a static value, the `actionJs()` method also accepts a function to dynamically calculate it. You can inject various utilities into the function as parameters.</UtilityInjection>
543
543
544
544
<Asidevariant="warning">
545
-
When using `jsAction()`, the action cannot open a modal or perform any server-side processing. It is intended for simple client-side interactions only. If you need to run PHP code, use the `action()` method instead.
545
+
When using `actionJs()`, the action cannot open a modal or perform any server-side processing. It is intended for simple client-side interactions only. If you need to run PHP code, use the `action()` method instead.
546
546
</Aside>
547
547
548
548
<Asidevariant="danger">
549
-
Any JavaScript string passed to the `jsAction()` method will be executed in the browser, so you should never add user input directly into the string, as it could lead to cross-site scripting (XSS) vulnerabilities. User input from `$get()` should never be evaluated as JavaScript code, but is safe to use as a string value.
549
+
Any JavaScript string passed to the `actionJs()` method will be executed in the browser, so you should never add user input directly into the string, as it could lead to cross-site scripting (XSS) vulnerabilities. User input from `$get()` should never be evaluated as JavaScript code, but is safe to use as a string value.
Copy file name to clipboardExpand all lines: packages/forms/docs/01-overview.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -637,7 +637,7 @@ TextInput::make('name')
637
637
<AutoScreenshotname="forms/fields/below-content/action"alt="Form field with action below content"version="4.x" />
638
638
639
639
<Asidevariant="tip">
640
-
If you need a simple action that runs JavaScript without making a network request, you can use the [`jsAction()` method](../actions/overview#running-javascript-when-an-action-is-clicked). This is useful for simple interactions like updating form field values using `$get()` and `$set()`. Actions using `jsAction()` cannot open modals.
640
+
If you need a simple action that runs JavaScript without making a network request, you can use the [`actionJs()` method](../actions/overview#running-javascript-when-an-action-is-clicked). This is useful for simple interactions like updating form field values using `$get()` and `$set()`. Actions using `actionJs()` cannot open modals.
641
641
</Aside>
642
642
643
643
You can insert any combination of content into the slots by passing an array of content to the method:
0 commit comments