example: use onsubmit to showcase entry

This commit is contained in:
Jonathan Kelley committed 2022-02-04 21:02:53 -05:00
1 parent 28e9e4373e
commit a939df677a
1 file changed
+3 -1
+3 -1
View File
@@ -14,10 +14,12 @@ fn app(cx: Scope) -> Element {
div { div {
h1 { "Form" } h1 { "Form" }
form { form {
oninput: move |ev| println!("{:?}", ev.values), onsubmit: move |ev| println!("Submitted {:?}", ev.values),
oninput: move |ev| println!("Input {:?}", ev.values),
input { r#type: "text", name: "username" } input { r#type: "text", name: "username" }
input { r#type: "text", name: "full-name" } input { r#type: "text", name: "full-name" }
input { r#type: "password", name: "password" } input { r#type: "password", name: "password" }
button { "Submit the form" }
} }
} }
}) })