Create-select has no way to specify a default value? #121
-
Looking at Tutorial 9 on forms, I do not see a way to pre-select (e.g. have a default value) in a select box. Am I missing something? As a side note, I do not use cl-dbi, but reading the tutorials left me very puzzled on how I would access anything other than sqlite. It might be useful to have an example using accessing one of the other databases. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The main way to add options to a select box is to use the create-option method, to make it the selected object, just add :selected t
I will add some comments soon, as it is just a matter of how you initialize dbi. mysql: (defvar connection postgres: (defvar connection sqlite: (defvar connection There is also a driver for Oracle as well and others could be added easily. The github is at - https://github.com/fukamachi/cl-dbi |
Beta Was this translation helpful? Give feedback.
The main way to add options to a select box is to use the create-option method, to make it the selected object, just add :selected t
The convenience function add-select-option also has that option. add-select-option does not currently provide a way, but that would be a trivial enhancement. I will look in to it in the near future after my first iterations on clog-web-site are done and a few important features like alignment features in the builder.
I will add some comments soon, as it is just a matter of how you initialize dbi.
mysql:
(defvar connection
(dbi:connect :mysql
:…