-
Notifications
You must be signed in to change notification settings - Fork 55
Closed
Labels
Description
For radio button groups.
module bind =
val radio : group:string -> thisButtonValue:string -> onChecked:(unit -> unit) -> Attr
// Example use:
let myRadioList model dispatch =
forEach {1..10} <| fun ix ->
input [
bind.radio "mygroup" (string ix) (fun () -> dispatch (SetMyGroup ix))
]
// Equivalent to:
let myRadioList model dispatch =
forEach {1..10} <| fun ix ->
input [
attr.``type`` "radio"
attr.name "mygroup"
attr.value (string ix)
on.change (fun args ->
if (args.Value :?> string) = string ix then
dispatch (SetMyGroup ix))
]