PHP 联系表单:我可以采用跨度值而不是输入值吗?

发布于 2024-09-17 11:41:46 字数 361 浏览 14 评论 0原文

我正在设置一个联系表单,但我在某些跨度中保存了一些信息(这是一个电子商务购物篮),并且内置的结账功能很糟糕,所以我们只是拼凑出一个简单的解决方案:将其转换为电子邮件表单,然后通过电子邮件将订单发送给我们,而不是失去客户。

无论如何,我可以使用跨度中的信息,获取idname,还是必须将其转换为输入?如果我这样做,如何禁用输入字段?

我想要纳入电子邮件的代码示例在此 jsFiddle 中,我想要带有 name=" 的跨度实际价格”等通过电子邮件发送。这可能吗?

谢谢 :)

I'm setting up a contact form, but I have some saved information in some spans (It's an ecommerce shopping basket) and the built in checkout is awful so we're just slapping together an easy solution: turn it into an email form and email us the order instead of losing customers.

Anyway, can I use the info in the span, taking the id or name or do I have to turn it into an input? And if I do, how can I disable the input field?

Example of code I want to take into the email is in this jsFiddle, I want the spans with name="ACTUAL PRICE" etc emailed. Is this possible?

Thanks :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

丘比特射中我 2024-09-24 11:41:46

也许您想使用隐藏的输入字段。

<input type="hidden" name="key" value="foobar" />

它不会显示,但可用于通过表单提交信息。

Maybe you want to use a hidden input field.

<input type="hidden" name="key" value="foobar" />

It is not displayed, but can be used to submit information with the form.

倾城花音 2024-09-24 11:41:46

如果可能的话,使用隐藏的表单字段会更好。否则,如果用户禁用了 JS,您可能会遇到问题。罕见但可能。

You'd be far better off using hidden form fields if possible. Else if the user has JS disabled you may run in to issues down the line. Rare but possible.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文