Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save benjclark/f68fecacfb4b5744acb6c09db59ed46d to your computer and use it in GitHub Desktop.

Select an option

Save benjclark/f68fecacfb4b5744acb6c09db59ed46d to your computer and use it in GitHub Desktop.
t.forEach((function(e) {
var t = e.getAttribute("ms-field") || e.getAttribute("data-ms-member");
if ("email" !== t && "password" !== t) {
t = t.replace(/[^a-zA-Z\s]+/g, "-").toLowerCase();
var r = e.getAttribute("type");
if ("checkbox" === r)
o[t] = e.checked;
else if ("radio" === r) {
var n = e.getAttribute("name");
if (!i[n]) {
var a = document.querySelector("input[name=" + n + "]:checked");
a && (o[t] = a.value),
i[n] = !0
}
} else
o[t] = e.value
}
}
)),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment