Hacker News new | ask | show | jobs
by MiroslavPokorny 52 days ago
I like it. Brief and concentrates on defining the form without any verbosity.

Do you have any plans for describing some basic constraints like a number range or a field should only accept dates after X. Im asking because as a markup for a form builder its very nice but its missing the next level of validation constraints.

1 comments

Yeah! this is mostly already supported:

  ? A date after today
  [date min="2026-10-13"]

  ? A number between 10 and 100 that's a multiple of 5
  [number min=10 max=100 step=5]
I didn't want to pack everything on the homepage example, but there's more examples in the form builder.

Also see:

https://askdown.dev/spec#4-question-types

Is it possible to plugin custom types or validator functions ?
No, there not really an extension system. I kind of consider the html renderer more of an example implementation, and assume people would want to build implementations in their framework of choice, but I can totally see it would be nice for people to define their own question types and hook into the renderer / validator.