From c6b4e9ff771cf8e697ea36dd31230c03cacf5442 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 29 May 2011 12:44:31 -0400 Subject: Properly handle form textboxes that have sources --- tests/tsource.ur | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/tsource.ur (limited to 'tests/tsource.ur') diff --git a/tests/tsource.ur b/tests/tsource.ur new file mode 100644 index 00000000..20cb4860 --- /dev/null +++ b/tests/tsource.ur @@ -0,0 +1,28 @@ +fun doSubmit r = + return Done {[readError r.Amount1 * readError r.Amount2 * 2.0]} + +fun main () = + amount1S <- source "1"; + amount2S <- source "1"; + return +
+ + + + +
Amount1:
Amount2:
Total:
+ + + +
+ +and showTotal amount1S amount2S = + a1 <- signal amount1S; + a2 <- signal amount2S; + return (case ((read a1), (read a2)) of + (None, _) => + | (_, None) => + | (Some a, Some b) => {[a * b * 2.0]}) -- cgit v1.2.3