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: adminforth/documentation/docs/tutorial/03-Customization/13-standardPagesTuning.md
+75-28Lines changed: 75 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -677,34 +677,6 @@ export default {
677
677
> `minValue` and `maxValue` checks are enforced both on frontend and backend.
678
678
679
679
680
-
### Validation
681
-
682
-
In cases when column values must follow certain format, you can add `validation` to it.
683
-
`validation` is an array of rules, each containing `regExp` that defines a format for a value and `message` that will be displayed in case when entered value does not pass the check.
message: 'Email is not valid, must be in format example@test.com',
698
-
},
699
-
],
700
-
},
701
-
],
702
-
},
703
-
...
704
-
],
705
-
```
706
-
707
-
> `validation` checks are enforced both on frontend and backend.
708
680
709
681
### Input prefix and suffix
710
682
@@ -967,6 +939,81 @@ When defined like this, adminforth will use value in `property_type` to figure o
967
939
968
940
If `beforeDatasourceRequest` or `afterDatasourceResponse` hooks are set for polymorphic foreign resource, they will be called for each resource in `polymorphicResources` array.
969
941
942
+
## Validation (create/edit view)
943
+
In cases when column values must follow certain format, you can add `validation` to it.
944
+
`validation` is an array of rules, each containing `regExp` or `validator function` that defines a format for a value and `message` that will be displayed in case when entered value does not pass the check.
945
+
946
+
### Frontend validation
947
+
We recomend to use this validation with regExp, because it validates fields in real time
0 commit comments