Hacker News new | past | comments | ask | show | jobs | submit login

As always (not go specific), forms example is missing form validation. Is that too old-fashioned?



What kind of validation are you looking for? Simple things like "is not empty", "maximum 8 characters"...?

Most libraries I've seen which try to do form validation always lack in certain areas or force you to define your own validation, so I simply ended up adding an `isValid` method to my structs.


I want to see a full roundtrip:

1. define input fields in html template of choice

2. validate form/struct/whatever and prepare errror messages per field

3. redisplay html with field-level errors to let user correct its input

step 3. is the interesting and missing in most examples of newer webframeworks




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: