badkins
2020-10-2 20:42:43

I noticed a fair amount of work has been done with formlets, but it’s not super clear to me how I might make use of that in HTML templates. For example: (formlet-display (multiselect-input '("one" "two" "three"))) ==> '((select ((multiple "true") (name "input_0")) (option ((value "0")) "one") (option ((value "1")) "two") (option ((value "2")) "three"))) (xexpr->string (car (formlet-display (multiselect-input '("one" "two" "three"))))) ===> "<select multiple=\"true\" name=\"input_0\"><option value=\"0\">one</option><option value=\"1\">two</option><option value=\"2\">three</option></select>" Surely this isn’t the way, and I would need to be able to specify option values and the name attribute. /cc @jeapostrophe


jeapostrophe
2020-10-2 20:47:14

@jeapostrophe has joined the channel


jeapostrophe
2020-10-2 20:47:44

The whole idea of formlets is that you don’t specify those names


jeapostrophe
2020-10-2 20:47:50

Because you might make a mistake


jeapostrophe
2020-10-2 20:48:58

Use formlet-process on the request that comes back and the original formlet, and it will return the user input


badkins
2020-10-2 20:56:18

Ok, sounds like I can’t use just the piece that renders the html then.