Hacker News new | ask | show | jobs
by cm2187 3625 days ago
No by URL I meant the URL of the service that would provide the autocomplete or the validation. Like:

  <input type="text" validation="url1" autocomplete="url2" ...
1 comments

I'm not sure how either of these would help:

- validation: Fundamentally, to be able to trust the input, the server needs to validate it in its final state. The only reason validation should be done on the client is to reduce the latency from the time the user inputs the data to the time the validation result is reported, so the user can fix their input faster if it fails validation. Sending it to a URL before form submit doesn't make sense when the input will have to be validated after form submit anyway.

- autocomplete: It's unlikely that implementing this in native code will be faster than in Javascript. It's not significantly faster to make an HTTP request in native code -- native code is more advantageous for heavy computation, graphics, and multithreading. And yet, it's easy enough to make HTTP requests from Javascript that an autocomplete attribute wouldn't add much value.

Being faster is not the point. Having to rely less on javascript libraries and more on the built in framework in the point.

And client side validation is not a substitute for server side validation, merely a better UX.