Philip on Nostr: I read a blog post today that was happily explaining how you can use built-in browser ...
I read a blog post today that was happily explaining how you can use built-in browser APIs to do form validation. Right out of the gate the example used was
`<input required={true} />`
Uh oh. That’s not a plain browser API.
Further down was code to customise validation using `setCustomValidity()` except everything was wired up using React (I think), not vanilla JS.
#webDev… (1/2)
Published at
2024-11-02 00:43:05 UTCEvent JSON
{
"id": "b536310f1ee2ca147dc382e6b6a3f05303e6a7aa5bba505e728ab653d9fb4cd9",
"pubkey": "f85039ccdcddacd87fca5e00617f93837ae062fb8dfe54e2297b8f13e60fe2aa",
"created_at": 1730508185,
"kind": 1,
"tags": [
[
"proxy",
"https://mastodon.nz/@mez/113410584430538451",
"web"
],
[
"t",
"webdev"
],
[
"proxy",
"https://mastodon.nz/users/mez/statuses/113410584430538451",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://mastodon.nz/users/mez/statuses/113410584430538451",
"pink.momostr"
],
[
"-"
]
],
"content": "I read a blog post today that was happily explaining how you can use built-in browser APIs to do form validation. Right out of the gate the example used was\n`\u003cinput required={true} /\u003e`\nUh oh. That’s not a plain browser API. \n\nFurther down was code to customise validation using `setCustomValidity()` except everything was wired up using React (I think), not vanilla JS.\n\n#webDev… (1/2)",
"sig": "928708d1635f2925c8cf91af21f1e260976cf036d40bf805d49369e8a82b8a9ad3bf558dc4329aff6fc8c144d6dd491151a9a2160fef0bfb7acf0d04f7117043"
}