简体   繁体   English

如何在不使用服务器端语言的情况下从 HTML 表单存储/发送数据?

[英]How do I store/send data from a HTML form without using a server side language?

Essentially, I have a form that has data required to be written to a database/exported or sent to someone.本质上,我有一个表单,其中包含需要写入数据库/导出或发送给某人的数据。 However, I am unable to use a server side language like PHP as this form is hosted on Shopify.但是,我无法使用像 PHP 这样的服务器端语言,因为此表单托管在 Shopify 上。 I did not use Shopify's form builder or any of the form plugins as there was a lot of logic jumping and calculation in the form.我没有使用 Shopify 的表单构建器或任何表单插件,因为表单中有很多逻辑跳转和计算。 The form was made with Bootstrap + JavaScript for the calculation/logic.该表单是使用 Bootstrap + JavaScript 制作的,用于计算/逻辑。

I understand that this might be an impossible task, but no harm trying I guess.我知道这可能是一项不可能完成的任务,但我想尝试没有坏处。

Any solution is appreciated, thank you!任何解决方案表示赞赏,谢谢!

You can tryout something like this你可以尝试这样的东西

   <form id="sendNameForm" onSubmit="sendName()">
    <input id="myName" name="name">
    <input type='submit' value='send'/>
   </form>

 function sendName(){
  let name = document.getElementById('myName').value
  localStorage.setItem('name', name)
  }

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 JavaScript 将 HTML 表单数据通过电子邮件发送到电子邮件 ID,而不使用服务器端语言,而不使用电子邮件客户端安全? - How to send HTML form data by email to an email ID by using JavaScript, without using server-side language, without using email client securely? 如何将信息从 HTML 发送回服务器端 - How do I send information back from HTML to the server side 如何在不使用服务器的情况下将表单数据存储在 HTML 文档中? - How can I store form data in an HTML document without using a server? 如何在服务器上使用Ajax发送没有表单的文件数据? - How Do I Send The File Data Without Form With Ajax On Server? 如何使用asp.net作为服务器端语言在服务器上存储json文件以及如何使用javascript,html和css访问json数据? - how to store json file at server using asp.net as server side language and how to access json data using javascript, html and css? 如何使用 javascript(不使用 jquery)将 HTML 表单数据发送到 JSON? - How do I send HTML form data to JSON using javascript (without jquery)? 如何使用angular将表单数据发送到服务器? - How do I send form data to server using angular? 如何从html文本格式存储文本或将文本发送到tomcat服务器? - How to store or send text to tomcat server from html text form? 如何将数据从客户端表单输入传输到服务器端Nodejs脚本? - How do I transfer data from a client-side form input to a server-side Nodejs script? 如何使用HTML表单将数据发送和存储在XML文件中? - How to send and store data in an XML file, using an HTML form?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM