Skip to content

Commit c3a9b61

Browse files
authored
docs: enhance validation guide with tip on preventing submission when form is untouched (#1814)
* Enhance validation guide with preventing submission tip Added guidance on preventing form submission before interaction. * move the tip after the code block to no break logic * enhance guide for all frameworks
1 parent d0e8ad3 commit c3a9b61

File tree

6 files changed

+12
-0
lines changed

6 files changed

+12
-0
lines changed

docs/framework/angular/guides/validation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,3 +688,5 @@ export class AppComponent {
688688
// ...
689689
}
690690
```
691+
692+
To prevent the form from being submitted before any interaction, combine `canSubmit` with `isPristine` flags. A simple condition like `!canSubmit || isPristine` effectively disables submissions until the user has made changes.

docs/framework/lit/guides/validation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,3 +629,5 @@ class MyForm extends LitElement {
629629
}
630630
}
631631
```
632+
633+
To prevent the form from being submitted before any interaction, combine `canSubmit` with `isPristine` flags. A simple condition like `!canSubmit || isPristine` effectively disables submissions until the user has made changes.

docs/framework/react/guides/validation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,3 +559,5 @@ return (
559559
/>
560560
)
561561
```
562+
563+
To prevent the form from being submitted before any interaction, combine `canSubmit` with `isPristine` flags. A simple condition like `!canSubmit || isPristine` effectively disables submissions until the user has made changes.

docs/framework/solid/guides/validation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,3 +564,5 @@ return (
564564
/>
565565
)
566566
```
567+
568+
To prevent the form from being submitted before any interaction, combine `canSubmit` with `isPristine` flags. A simple condition like `!canSubmit || isPristine` effectively disables submissions until the user has made changes.

docs/framework/svelte/guides/validation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,3 +404,5 @@ You can subscribe to it via `form.Subscribe` and use the value in order to, for
404404
{/snippet}
405405
</form.Subscribe>
406406
```
407+
408+
To prevent the form from being submitted before any interaction, combine `canSubmit` with `isPristine` flags. A simple condition like `!canSubmit || isPristine` effectively disables submissions until the user has made changes.

docs/framework/vue/guides/validation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,3 +583,5 @@ const form = useForm(/* ... */)
583583
<!-- ... -->
584584
</template>
585585
```
586+
587+
To prevent the form from being submitted before any interaction, combine `canSubmit` with `isPristine` flags. A simple condition like `!canSubmit || isPristine` effectively disables submissions until the user has made changes.

0 commit comments

Comments
 (0)