PHP 联系表单:我可以采用跨度值而不是输入值吗?
我正在设置一个联系表单,但我在某些跨度中保存了一些信息(这是一个电子商务购物篮),并且内置的结账功能很糟糕,所以我们只是拼凑出一个简单的解决方案:将其转换为电子邮件表单,然后通过电子邮件将订单发送给我们,而不是失去客户。
无论如何,我可以使用跨度中的信息,获取id
或name
,还是必须将其转换为输入?如果我这样做,如何禁用输入字段?
我想要纳入电子邮件的代码示例在此 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许您想使用隐藏的输入字段。
它不会显示,但可用于通过表单提交信息。
Maybe you want to use a hidden input field.
It is not displayed, but can be used to submit information with the form.
如果可能的话,使用隐藏的表单字段会更好。否则,如果用户禁用了 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.