Mercurial > urweb
view demo/subforms.ur @ 1907:cb57ba73a61d
make uninstall: Uninstall types_cpp.h, urweb_cpp.h
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
author | Anders Kaseorg <andersk@mit.edu> |
---|---|
date | Fri, 22 Nov 2013 09:36:14 -0500 |
parents | be0c4e2e488a |
children |
line wrap: on
line source
fun sub r = let fun sub' ls = case ls of [] => <xml/> | r :: ls => <xml> <li>{[r.Num]} = {[r.Text]}</li> {sub' ls} </xml> in return <xml><body> {sub' r.Lines} </body></xml> end fun subfrms n = if n <= 0 then <xml/> else <xml> <entry> <hidden{#Num} value={show n}/> <li>{[n]}: <textbox{#Text}/></li> </entry> {subfrms (n - 1)} </xml> fun form n = return <xml><body> <form> <subforms{#Lines}> {subfrms n} </subforms> <submit action={sub}/> </form> <a link={form (n + 1)}>One more blank</a><br/> {if n > 0 then <xml><a link={form (n - 1)}>One fewer blank</a></xml> else <xml/>} </body></xml> fun main () = form 1