new deploy: 2022-12-30T20:12:15+00:00
This commit is contained in:
parent
cbcf73428c
commit
55207b0068
2 changed files with 8 additions and 3 deletions
|
@ -91,7 +91,11 @@ on enable forms.</p>
|
|||
<h3 id="html-forms">HTML Forms <a class="anchor" href="#html-forms"></a></h3>
|
||||
<p>Forms can be added to websites with just the HTML code for it. For
|
||||
instance:</p>
|
||||
<pre data-lang="html" style="background-color:#eff1f5;color:#4f5b66;" class="language-html "><code class="language-html" data-lang="html"><span><</span><span style="color:#bf616a;">form </span><span style="color:#8fa1b3;">id</span><span>="</span><span style="color:#a3be8c;">newsletter-form</span><span>" </span><span style="color:#d08770;">method</span><span>="</span><span style="color:#a3be8c;">POST</span><span>">
|
||||
<pre data-lang="html" style="background-color:#eff1f5;color:#4f5b66;" class="language-html "><code class="language-html" data-lang="html"><span><</span><span style="color:#bf616a;">form
|
||||
</span><span> </span><span style="color:#8fa1b3;">id</span><span>="</span><span style="color:#a3be8c;">newsletter-form</span><span>"
|
||||
</span><span> </span><span style="color:#d08770;">method</span><span>="</span><span style="color:#a3be8c;">POST</span><span>"
|
||||
</span><span> </span><span style="color:#d08770;">action</span><span>="</span><span style="color:#a3be8c;">https://<librepages-endpoint>/?path=<current-path>&host=<current-host></span><span>"
|
||||
</span><span>>
|
||||
</span><span> <</span><span style="color:#bf616a;">p</span><span>>
|
||||
</span><span> Interested in receiving latest news about our cool product? Sign
|
||||
</span><span> up for you fantastic newsletter!
|
||||
|
@ -124,7 +128,8 @@ will be using <a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_AP
|
|||
</span><span> </span><span style="color:#b48ead;">const </span><span style="color:#bf616a;">form </span><span>= document.</span><span style="color:#bf616a;">getElementById</span><span>("</span><span style="color:#a3be8c;">newsletter-form</span><span>");
|
||||
</span><span>
|
||||
</span><span> </span><span style="color:#b48ead;">async function </span><span style="color:#8fa1b3;">handleSubmit</span><span>() {
|
||||
</span><span> </span><span style="color:#b48ead;">const </span><span style="color:#bf616a;">url </span><span>= window.location;
|
||||
</span><span> </span><span style="color:#b48ead;">const </span><span style="color:#bf616a;">url </span><span>=
|
||||
</span><span> "</span><span style="color:#a3be8c;">https://<librepages-endpoint>/api/v1/forms/submit?host=<current-host>&path=<current-path></span><span>";
|
||||
</span><span> </span><span style="color:#b48ead;">const </span><span style="color:#bf616a;">data </span><span>= {
|
||||
</span><span> email: document.</span><span style="color:#bf616a;">getElementById</span><span>("</span><span style="color:#a3be8c;">email</span><span>"),
|
||||
</span><span> };
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue