I'm developing a simple point-of-sale web app, and part of that is there is a credit card field. This field is for entering a customer's credit card, and therefore the number should neither
我正在开发一个简单的销售点网络应用程序,其中一部分是信用卡领域。此字段用于输入客户的信用卡,因此该号码不应该
a) be saved by the browser, or
a)由浏览器保存,或
b) or be loaded from the local computer.
b)或从本地计算机加载。
The app is used for my reps to enter credit card info on behalf of a customer who they are ringing up.
该应用程序用于我的销售代表代表他们正在响铃的客户输入信用卡信息。
I can tell them not to save the card but it would be best to disable the feature. I've seen a number of posts about this but it seems they are either outdated or slightly different use cases.
我可以告诉他们不要保存卡,但最好禁用该功能。我已经看过很多关于这个的帖子,但看起来它们已经过时或者用例略有不同。
This is the HTML for my field -
这是我的字段的HTML -
<input autocomplete="off" class="form-control" id="creditcard" placeholder="Credit card number" type="text">
2 个解决方案
#1
0
You Can Use autocomplete
Attribute And Set Its Value To off
.. like this:
您可以使用自动完成属性并将其值设置为关闭..像这样:
<input type="text" id="creditCard" autocomplete="off" />
#2
0
One approach that can be used is to use a unique id/name for the input, unfortunately this makes the form processing more complex because the server must remember what name/id was sent.
可以使用的一种方法是为输入使用唯一的id / name,遗憾的是,这使得表单处理更加复杂,因为服务器必须记住发送的名称/ id。
However, it should prevent the browser from reusing entered data.
但是,它应该阻止浏览器重用输入的数据。
#1
0
You Can Use autocomplete
Attribute And Set Its Value To off
.. like this:
您可以使用自动完成属性并将其值设置为关闭..像这样:
<input type="text" id="creditCard" autocomplete="off" />
#2
0
One approach that can be used is to use a unique id/name for the input, unfortunately this makes the form processing more complex because the server must remember what name/id was sent.
可以使用的一种方法是为输入使用唯一的id / name,遗憾的是,这使得表单处理更加复杂,因为服务器必须记住发送的名称/ id。
However, it should prevent the browser from reusing entered data.
但是,它应该阻止浏览器重用输入的数据。