[openstreetmap/openstreetmap-website] Add some javascript to check dynamically if the username is already taken (PR #4402)

Anton Khorev notifications at github.com
Wed Dec 13 11:49:01 UTC 2023


@AntonKhorev commented on this pull request.



> +  if (isValid) {
+    el.classList.add("is-valid")
+    el.classList.remove("is-invalid")
+  } else {
+    el.classList.add("is-invalid")
+    el.classList.remove("is-valid")
+  }

```js
el.classList.toggle("is-valid", isValid)
el.classList.toggle("is-invalid", !isValid)
```

or `$("#user_display_name").toggleClass("is-valid", isValid)` etc if we're still using jquery

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4402#pullrequestreview-1779462305
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/4402/review/1779462305 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20231213/a51b23cc/attachment.htm>


More information about the rails-dev mailing list