diff demo/form.ur @ 406:a71600cac815

Form example
author Adam Chlipala <adamc@hcoop.net>
date Tue, 21 Oct 2008 17:30:06 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/demo/form.ur	Tue Oct 21 17:30:06 2008 -0400
@@ -0,0 +1,18 @@
+fun handler r = return <xml><body>
+  <table>
+    <tr> <th>A:</th> <td>{[r.A]}</td> </tr>
+    <tr> <th>B:</th> <td>{[r.B]}</td> </tr>
+    <tr> <th>C:</th> <td>{[r.C]}</td> </tr>
+  </table>
+</body></xml>
+
+fun main () = return <xml><body>
+  <form>
+    <table>
+      <tr> <th>A:</th> <td><textbox{#A}/></td> </tr>
+      <tr> <th>B:</th> <td><textbox{#B}/></td> </tr>
+      <tr> <th>C:</th> <td><checkbox{#C}/></td> </tr>
+      <tr> <th/> <td><submit action={handler}/></td> </tr>
+    </table>
+  </form>
+</body></xml>