[英]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.