Created
December 9, 2018 23:59
-
-
Save goatandsheep/ba5dd3eea9ef5b7b1864797d020c20fb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
render() { | |
return html` | |
<section> | |
<form id="form-${this._ref}" @submit="${this._login}"> | |
<label> | |
Username: | |
<input type="text" name="username"> | |
</label> | |
<label> | |
Password: | |
<input type="password" name="password"> | |
</label> | |
<button type="submit">Login</button> | |
</form> | |
</section> | |
`; | |
} | |
_login(evt) { | |
evt.preventDefault(); | |
const formData = (new FormData(evt.target)).entries(); | |
let filtered = {}; | |
for (let pair of formData) { | |
filtered[pair[0]] = pair[1].trim(); | |
} | |
// TODO: use filtered | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment