File tree Expand file tree Collapse file tree 1 file changed +7
-15
lines changed
Expand file tree Collapse file tree 1 file changed +7
-15
lines changed Original file line number Diff line number Diff line change 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 ( )
You can’t perform that action at this time.
0 commit comments