Arc Forumnew | comments | leaders | submitlogin
3 points by skenney26 6136 days ago | link | parent

You could also use a function.

Add this after opsel in html.arc:

  ; minimized attribute (use w/ selected, checked)
  (def opmin (key val) 
    `(if ,val (pr " " ',key)))
Add this to the list of attributes in html.arc:

  (attribute input checked opmin)
Add this wherever you like:

  (def checkbox (name (o checked))
    (gentag input type 'checkbox name name checked checked))
A test webpage:

  (defop checkboxes req
    (checkbox 1 t)
    (br)
    (checkbox 2))
This is the resulting source code:

  <input type=checkbox name="1" checked><br>
  <input type=checkbox name="2">


1 point by gidyn 6135 days ago | link

Thank you. Exactly what I need.

-----