Permalink
Browse files

use select and radio

  • Loading branch information...
1 parent b63f144 commit 8d2aaf7a29e4e5a30cf549f004051f070618bd36 @sunfmin committed Apr 21, 2012
Showing with 10 additions and 7 deletions.
  1. +7 −5 handlers/forms/accounts.go
  2. +3 −2 handlers/home/handlers.go
View
@@ -7,17 +7,19 @@ import (
func AccountRegisterForm() (f *goform.Builder) {
f = goform.NewFormBuilder()
- f.TextField("Name")
- f.Select("Gender").Collection(func(fo goform.FormObject, env Env) goform.Options {
+ f.TextField("Name").Placeholder("Type your name")
+
+ f.RadioButtons("Gender").Collection(func(fo goform.FormObject, env Env) goform.Options {
return goform.StringOptions([][]string{
{"1", "Men"},
{"2", "Women"},
})
})
- f.RadioButtons("Gender").Collection(func(fo goform.FormObject, env Env) goform.Options {
+
+ f.Select("Department").Collection(func(fo goform.FormObject, env Env) goform.Options {
return goform.StringOptions([][]string{
- {"1", "Men"},
- {"2", "Women"},
+ {"HR", "Human Resource"},
+ {"IT", "IT Development"},
})
})
return
@@ -9,8 +9,9 @@ import (
func Index(env Env) (status Status, headers Headers, body Body) {
a := &accounts.Account{
- Name: "Felix",
- Gender: "2",
+ Name: "Felix",
+ Gender: "2",
+ Department: "IT",
}
mangotemplate.ForRender(env, "home/index", forms.AccountRegisterForm().Render(a, env))
return

0 comments on commit 8d2aaf7

Please sign in to comment.