-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
I having having problem with binding the form data.
The input would be like this
<input name="codes[1][icode]" type="number" />
<input name="codes[1][limit]" type="text" />
<input name="codes[2][icode]" type="number" />
<input name="codes[2][limit]" type="text" />
And the struct
type Event struct {
gorm.Model
Code []InvideCode `form:"codes"`
}
type InvideCode struct {
gorm.Model
EventID uint
Code string `form:"icode"`
Limit string `form:"limit"`
}
And i bind it with
event := new(Event)
or
c.FormValue("codes")
Both give me the empty value.
What did I done wrong?
Actually there is similar problem was asked at SO , the accepted answer is using 3rd party library and I don't like it. I wonder if there any Echo way to do it.
Demetri0 and kidlj
Metadata
Metadata
Assignees
Labels
No labels