Skip to content

Commit 3de7d0b

Browse files
committed
feat: state update
1 parent 52b5696 commit 3de7d0b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/content/docs/reference/forms/events-and-triggers.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,14 @@ function onSearch(){
8989

9090
This example shows how to:
9191
- Use a search input that submits on Enter key press
92-
- If we hav'nt used the 'onSubmitClick', it will default to the last button with 'whenFormOK' attribute
92+
- If we hav'nt used the 'onSubmitClick', it will default to the last button with 'whenFormOK' attribute
93+
94+
95+
### Reloading state without click on submit button
96+
97+
When you only want to update the form state - reload the form without the need to click on a submit button.
98+
99+
```astro
100+
<BInput type="checkbox" name="showContent" onchange="submitForm(this)" onSubmitClick="state"/>
101+
{form.showContent ? 'Content is shown' : 'Content is hidden'}
102+
```

0 commit comments

Comments
 (0)