From e2a97f10597aaa66d2fdc02e40a482fbe7a6772d Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Sat, 31 Dec 2022 01:41:18 +0530 Subject: [PATCH] feat: update forms instructions closes: https://git.batsense.net/LibrePages/docs/issues/1 --- content/forms/add.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/content/forms/add.md b/content/forms/add.md index 5cca259..f4f8632 100644 --- a/content/forms/add.md +++ b/content/forms/add.md @@ -24,7 +24,11 @@ Forms can be added to websites with just the HTML code for it. For instance: ```html -
+

Interested in receiving latest news about our cool product? Sign up for you fantastic newsletter! @@ -60,7 +64,8 @@ JavaScript code: const form = document.getElementById("newsletter-form"); async function handleSubmit() { - const url = window.location; + const url = + "https:///api/v1/forms/submit?host=&path="; const data = { email: document.getElementById("email"), }; @@ -77,4 +82,5 @@ JavaScript code: form.addEventListener("submit", handleSubmit); ``` + > Note: the following snippet also demonstrates JSON form submission