Skip to content

Commit 4c366c0

Browse files
authored
Merge pull request #14 from github/demo-fix
Fix demo page
2 parents abf6ccf + 3f36402 commit 4c366c0

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

examples/index.html

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,25 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8">
5+
<script src="https://unpkg.com/selector-set@latest"></script>
6+
<script src="https://unpkg.com/form-data-entries@latest"></script>
57
<script src="https://unpkg.com/@github/remote-form@latest/dist/index.umd.js"></script>
68
<!-- <script src="../dist/index.umd.js"></script> -->
79
<title>remote-form demo</title>
810
</head>
911
<body>
10-
<form>
11-
<label for="username">Username</label>
12-
<input id="username" name="username" />
12+
<form action="https://httpbin.org/get">
13+
<label for="username" value="name">Username</label>
14+
<input id="username" name="username" type="text" required autofocus>
1315

1416
<button>Submit</button>
1517
</form>
1618

17-
<div id="results"></div>
19+
Request payload from httpbin.org:
20+
<pre id="results" aria-live="assertive">Empty</pre>
1821

1922
<script>
2023
const input = document.querySelector('input')
21-
function fakeFetch() {
22-
return new Promise(fetchResolve => {
23-
fetchResolve({
24-
status: 200,
25-
text: () => new Promise(
26-
textResolve => textResolve(input.value.toUpperCase())
27-
)
28-
})
29-
})
30-
}
31-
window.fetch = fakeFetch
3224

3325
remoteForm.remoteForm('form', async (form, wants) => {
3426
const response = await wants.text()

0 commit comments

Comments
 (0)