How to toggle/add/remove select box attribute(s) existance with checkbox

I think @pmario’s answer is simpler in this case, but note that you can also do this with the Genesis Widget

<$checkbox field="multi" checked="multiple"> Multi?</$checkbox>

<$checkbox field="size" checked="size"> Size = 8?</$checkbox>

<$genesis 
  $type="$select" 
  field="planets" 
  $names={{{ [{!!multi}] [{!!size}] +[join[ ]] }}}  
  $values={{{ [{!!multi}] [{!!size}then[8]] +[join[ ]] }}}
>
  <option>Mercury</option>
  <option>Venus</option>
  <option>Earth</option>
  <option>Mars</option>
  <option>Jupiter</option>
  <option>Saturn</option>
  <option>Uranus</option>
  <option>Neptune</option>
  <option>Pluto</option>
</$genesis>
(Hey, Pluto was considered a planet when I was a kid, and I see no reason for the downgrade!)

The important thing here is ensuring that the $names and $values are aligned.

You can try this by downloading the following and dragging the resulting file onto any tiddlywiki: Dynamic drop-down with Genesis Widget.json (767 Bytes)