Permalink
Browse files

Very basic demo of using SELECT tag in Opa.

  • Loading branch information...
0 parents commit d00622b19119ff1d13e647d72a69f4d461a568dc @akoprow committed Mar 12, 2012
Showing with 35 additions and 0 deletions.
  1. +5 −0 .gitignore
  2. +30 −0 select.opa
@@ -0,0 +1,5 @@
+*.exe
+_build
+_tracks
+*~
+*.log
@@ -0,0 +1,30 @@
+import stdlib.themes.bootstrap
+
+function selectOptions(list('a) opts) {
+ function render_option(o) {
+ <option>{o}</>
+ }
+ <>{List.map(render_option, opts)}</>
+}
+
+function page() {
+ list(int) numberRange = [2, 3, 4, 5, 6, 7, 8, 9]
+ <div class=container>
+ <form class=form-horizontal>
+ <legend>Simple selection demo with Opa</>
+ <fieldset>
+ <div class=control-group>
+ <label class=control-label for=select01>Make your choice</>
+ <div class=controls>
+ <select id=select01>
+ {selectOptions(numberRange)}
+ </>
+ </>
+ </>
+ </>
+ </>
+ </>
+}
+
+ // simple one-page server
+Server.start(Server.http, {title: "Form selection in Opa", ~page})

0 comments on commit d00622b

Please sign in to comment.