Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[spike] API for an easy way to add custom validation on a form #60

Open
maddalax opened this issue Oct 29, 2024 · 1 comment
Open

[spike] API for an easy way to add custom validation on a form #60

maddalax opened this issue Oct 29, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request spike If this is something that is just an experiment or should be permanent

Comments

@maddalax
Copy link
Owner

maddalax commented Oct 29, 2024

https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/setCustomValidity

rough draft api could maybe look something like:

h.Validation(opts ... ValidationOpt)

validation.Regex() ValidationOpt
validation.Js()
validation.Required()
validation.Partial(partial PartialFunc)
h.Input(
   h.Validation(
     validation.Regex()
   ) 
)

using partials and doing the validation in go code might be a better option tho... spike this and find out

@maddalax maddalax added the enhancement New feature or request label Oct 29, 2024
@maddalax maddalax self-assigned this Oct 29, 2024
@maddalax maddalax added the spike If this is something that is just an experiment or should be permanent label Oct 29, 2024
@maddalax maddalax changed the title API for an easy way to add custom validation on a form [spike] API for an easy way to add custom validation on a form Oct 29, 2024
@gedw99
Copy link

gedw99 commented Oct 29, 2024

This is definitely something on the immediate need list .

have a look at https://github.com/gedw99/goPocJsonSchemaForm

just go run .

Using htmx .

All server side .

It’s runtime based using json schema. No code gen . Been meaning to link it to a db schema lookup :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request spike If this is something that is just an experiment or should be permanent
Projects
None yet
Development

No branches or pull requests

2 participants