File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -46,25 +46,26 @@ renderValidationErrors xs =
46
46
-- event handler to update
47
47
formField :: String -> String -> String -> (String -> Effect Unit ) -> R.JSX
48
48
formField name placeholder value setValue =
49
- D .label
49
+ D .div
50
50
{ className: " form-group row"
51
51
, children:
52
- [ D .div
52
+ [ D .label
53
53
{ className: " col-sm col-form-label"
54
+ , htmlFor: name
54
55
, children: [ D .text name ]
55
56
}
56
57
, D .div
57
58
{ className: " col-sm"
58
59
, children:
59
60
[ D .input
60
61
{ className: " form-control"
62
+ , id: name
61
63
, placeholder
62
64
, value
63
65
, onChange:
64
66
let
65
67
handleValue :: Maybe String -> Effect Unit
66
68
handleValue (Just v) = setValue v
67
-
68
69
handleValue Nothing = pure unit
69
70
in
70
71
handler targetValue handleValue
Original file line number Diff line number Diff line change @@ -44,18 +44,20 @@ renderValidationErrors xs =
44
44
-- ANCHOR: formField
45
45
formField :: String -> String -> String -> (String -> Effect Unit ) -> R.JSX
46
46
formField name placeholder value setValue =
47
- D .label
47
+ D .div
48
48
{ className: " form-group row"
49
49
, children:
50
- [ D .div
50
+ [ D .label
51
51
{ className: " col-sm col-form-label"
52
+ , htmlFor: name
52
53
, children: [ D .text name ]
53
54
}
54
55
, D .div
55
56
{ className: " col-sm"
56
57
, children:
57
58
[ D .input
58
59
{ className: " form-control"
60
+ , id: name
59
61
, placeholder
60
62
, value
61
63
, onChange:
You can’t perform that action at this time.
0 commit comments