Re: [racket-users] Web server: can't get radio-group formlet to process

2016-02-12 Thread Jay McCarthy
Hi Marc, You should change https://github.com/racket/web-server/blob/master/web-server-lib/web-server/formlets/input.rkt#L148 so that if the list is empty, then you return some value that was passed as an extra keyword to `input-group` and `radio-group`. Can you check that and see if it works fo

Re: [racket-users] Web server: can't get radio-group formlet to process

2016-02-11 Thread Marc Kaufmann
Hi again, I just realized that I never figured out how to get radio-groups not to raise an error when no option is selected. I manage to put defaults for input-string and so on, by doing what Jay suggested and redefining my own through the use of 'default and 'input. In the case of radio-group, w

Re: [racket-users] Web server: can't get radio-group formlet to process

2016-01-25 Thread Marc Kaufmann
Done, although since it is my first pull request, let me know if I did it wrong (tried first without forking, which of course was nonsense). I tried to find a way to have the 'id' on radio the same as the 'for' on label, but I couldn't figure out well enough what is going on. Cheers, Marc On Mon

Re: [racket-users] Web server: can't get radio-group formlet to process

2016-01-18 Thread Jay McCarthy
Great Marc. If you want, you could submit a pull-request and we could add the wrap thing to the main library. Jay On Wed, Jan 13, 2016 at 5:00 PM, Marc Kaufmann wrote: > So, turns out I can answer my own question, if ugly hacks count. > > I copy-pasted (yep, DRY is my guiding principle: Do Repe

Re: [racket-users] Web server: can't get radio-group formlet to process

2016-01-13 Thread Marc Kaufmann
So, turns out I can answer my own question, if ugly hacks count. I copy-pasted (yep, DRY is my guiding principle: Do Repeat Yourself) the code for radio-group and the functions it depends on and changed the part of the code that creates the HTML in 'input-group' from (for/list ([vn (

Re: [racket-users] Web server: can't get radio-group formlet to process

2016-01-13 Thread Marc Kaufmann
Thanks Jay. On Mon, Jan 11, 2016 at 11:15 AM, Jay McCarthy wrote: > Hi Marc, > > Most formlets are typed as `(formlet/c (or/c false/c binding?))` where > the `binding?` is returned when the thing is there and the `#f` is > returned when it isn't. However, if you use `required`, then an > excepti

Re: [racket-users] Web server: can't get radio-group formlet to process

2016-01-11 Thread Jay McCarthy
Hi Marc, Most formlets are typed as `(formlet/c (or/c false/c binding?))` where the `binding?` is returned when the thing is there and the `#f` is returned when it isn't. However, if you use `required`, then an exception is thrown on the `#f` because the form element must be present. Formlets like

Re: [racket-users] Web server: can't get radio-group formlet to process

2016-01-10 Thread Marc Kaufmann
Thanks. Another question about formlets: when I use (formlet-process formlet-name) it will often raise errors when a field doesn't have a value. Is there an easy way of capturing errors, in particular to show the form as it was entered by the user, but with an error message at the top, rather than

Re: [racket-users] Web server: can't get radio-group formlet to process

2016-01-10 Thread Jay McCarthy
On Sun, Jan 10, 2016 at 3:50 PM, Marc Kaufmann wrote: > Hi, > > I manage to get the basic formlets to work, and tried the radiogroup, but it > fails with the following error: "input-group: invalid selection #f", even > though I had it selected. After some playing around, I saw that there are > two

[racket-users] Web server: can't get radio-group formlet to process

2016-01-10 Thread Marc Kaufmann
Hi, I manage to get the basic formlets to work, and tried the radiogroup, but it fails with the following error: "input-group: invalid selection #f", even though I had it selected. After some playing around, I saw that there are two input_0 fields being sent on submit, since I have another formlet