News for hackers. Stuff that matters.
Re:Living without the modern browser by ubermonkey on Wednesday July 10, 2019 @09:45AM (#20401867)
>Really, there is no reason why a form should require JavaScript.

This is one of those things that's technically true, but misleading.

Without scripting, you can't do any client-side validation, so you have to submit the form.

Without scripting, it's then harder to repop the form for the user when it fails.

I'm not saying things aren't excessive today -- they clearly are. But tossing client-side scripting entirely seems like a baby/bathwater situation.

Re:Living without the modern browser by seer on Wednesday July 10, 2019 @10:32AM (#20402300)
Html validation is actually quite powerful and can help with most "quality of life" validations. You know the "this field is required" or "this field needs to be a number" kind of thing.

Even more, html validation has by far a much better UX than most custom made JS solutions. For example if there is an error in the validation, your cursor is immediately transported to the offending field where you can do the correction, with the appropriate css classes available to highlight the field properly.

And for the stuff that html validation is not powerful enough, well then you most probably want to check that on the server as well anyway.

Re:Living without the modern browser by wilsonrocks on Wednesday July 10, 2019 @02:20PM (#20404759)
HTML5 validation is excellent, even better if you use JS to customise it...
Re:Living without the modern browser by gdfasfklshg4 on Wednesday July 10, 2019 @09:50AM (#20401904)
You need to re-do all your client-side user assistance prompts+ with real validation serverside anyway...

+ client-side validation is not validation.

Re:Living without the modern browser by spookthesunset on Wednesday July 10, 2019 @03:10PM (#20405342)
Server side validation is a backstop. It doesn't need to have fancy error messages or anything like that. Client side can have friendly, nice error handling and validation. Server side can damn near barf on the user's shoes when it encounters a validation issue.
Re:Living without the modern browser by zeveb on Wednesday July 10, 2019 @09:58AM (#20401971)
You absolutely have to do server-side validation anyway, since clients can lie.

Since you're doing the server-side validation you have to do anyway, it's child's play to return the HTML form with the values the client submitted pre-filled.

Client-side validation is a user convenience; it's awesome, but not sufficient in itself, because it can only protect the client, not the server, from invalid values.

Re:Living without the modern browser by brobdingnagians on Wednesday July 10, 2019 @09:57AM (#20401963)
Just use Weboolkit (Wt, http://webtoolkit.eu/). It handles graceful degredation on no-JS automatically. This is one of the neatest things about it, you get full single page interaction w/ sockets if supported, or just normal HTTP pages if Javascript is disabled or not supported.
Re:Living without the modern browser by s_y_n_t_a_x on Wednesday July 10, 2019 @11:13AM (#20402726)
Yes you can do client-side validation. You're constrained to the pattern fields and the browser implementation, but it's enough to block most invalid submissions.
Re:Living without the modern browser by dfox on Wednesday July 10, 2019 @09:56AM (#20401951)
Most forms either don't need any kind of validation or you still have to validate the data on the server and do something reasonable when it fails.

Repopulating the form on the server side after validation failure is trivial and even more so when there are libraries that abstract that away (eg. wtforms).

On a similar note I somehow fail to see the benefit of writing (and often duplicating) large parts of business logic in client-side javascript and replacing perfectly good HTML form-submission mechanism with random JSON "REST" APIs.

Re:Living without the modern browser by GrinningFool on Wednesday July 10, 2019 @11:37AM (#20402980)

    > Repopulating the form on the server side 
    > after validation failure is trivial 
You'd think so, but the number of sites out there that still require me to re-type the full form because one field failed validation is mind-boggling.