This commit is contained in:
parent
d697ad0b00
commit
35fb3c005f
1 changed files with 0 additions and 9 deletions
|
|
@ -25,21 +25,12 @@ type Person struct {
|
|||
```golang
|
||||
myForm := form.NewForm(
|
||||
form.NewFieldText("Name").
|
||||
WithOptions(
|
||||
form.NewOption("label", "Person"),
|
||||
form.NewOption("required", true),
|
||||
).
|
||||
WithConstraints(
|
||||
validation.NewNotBlank(),
|
||||
),
|
||||
form.NewFieldNumber("Age").
|
||||
WithOptions(
|
||||
form.NewOption("label", "Age"),
|
||||
form.NewOption("required", true),
|
||||
).
|
||||
WithConstraints(
|
||||
validation.NewNotBlank(),
|
||||
validation.New(),
|
||||
validation.NewRange().WithMin(18),
|
||||
),
|
||||
).End()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue