Web developers! Do you use html forms? Do you let forms submit or just use them for UI and call fetch()?
Don’t use forms? Tell me why. Do? Tell me what’s painful. Let’s see if we can fix it!
Web developers! Do you use html forms? Do you let forms submit or just use them for UI and call fetch()?
Don’t use forms? Tell me why. Do? Tell me what’s painful. Let’s see if we can fix it!
@keithamus Please fix the form validation messaging experience. The whole “let’s focus the first invalid field, show the error message, expect that you’ll hit submit once you’ve fixed it to go the next invalid one until the form is completely valid and ready to submit” experience is cute/clever but it’s confusing and does not match how users actually behave.
@keithamus And I have so little faith in the `title` attribute like some browsers are doing being the solution. Feels lazy.
@knowler can you describe how users actually behave?
@keithamus That’d need to be studied for accuracy, but I’m not sure if most people know “the rails” exist (i.e. advancing through invalid options one at a time, submitting each time — and that is the design of the browser behaviour, I can dig up links). For sighted users the invalid message popup is a mere suggestion of where to start. For keyboard users, their focus is moved, but they can move away. I think the process needs to optimize for a user who can explore and isn’t forced into completing the options in a particular order, as I would guess, users don’t always complete a form from top to bottom.
@keithamus it’s not what you asked, exactly, but forms desperately need a reliable way to use methods other than GET and POST
@sstephenson Id say that’s very much in line with what I was asking.
@keithamus I really want the request to come in as JSON, not form data. And often I don’t want the page to navigate.
@keithamus The date picker is terrible for things like birthdate in the past.
@keithamus Web forms have such a great UI, so I use them all the time to collect info from a user. But I basically never let the form POST/GET anywhere since I use the form data directly in the app, rather than sending data to a server.
Yes.
Basically this approach https://usefresh.dev/docs/advanced/forms and so basically there is no need to use client JS then …
Exceptions are mostly the things which need to be encrypted before like ActivityPub OAuth or IndieAuth etc.
@keithamus Yes, I do use forms and mostly let them submit. Sometimes use progressive enhancement and intercept the submit with JS .
As a user I hate form fields/buttons without submit behavior.
@keithamus You should talk to the WebMCP folks. Most of the need for the "imperative" API is about the ways that forms either don't work or aren't being used by most developers. (The rest is about how humans are thought to need their forms cut up into lots of short pages.)
@keithamus For the kind of apps I build, it's all `preventDefault()` and then `fetch()` (update: or even just local processing), but I like the semantics that come with it for free, like submit logic with error handling.
@keithamus yes HTML forms and yes submit! They're so easy, I don't want to mess around with having to call fetch(). They can be made nicer with partial page rendering or something, but a full page refresh is also okay when the pages are actually fast