php Bootstrap input type="number" 不做任何事情
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17536573/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Bootstrap input type="number" doesn't do anythying
提问by ed209
I have a form that I need to force users to input numbers into. However, the following doesn't work
我有一个表单,我需要强制用户输入数字。但是,以下不起作用
<input type="number" name="price[<?=$custom_item->quote_items_id?>]" value="" placeholder="$">
I can hit submit no matter what I type in. Is this a bootstrap thing? I thought it was a html5 thing that couldn't be overridden. If I change it to email it will force an email. Any suggestions?
无论我输入什么,我都可以点击提交。这是引导程序吗?我认为这是一个无法覆盖的 html5 东西。如果我将其更改为电子邮件,它将强制发送电子邮件。有什么建议?
回答by Dennis Traub
It depends on if/how the browser implements this feature.
这取决于浏览器是否/如何实现此功能。
You can check HTML5/CSS3 support for various browsers at caniuse.com. Here's the entry for the number input type.
您可以在caniuse.com 上查看对各种浏览器的 HTML5/CSS3 支持。这是数字输入类型的条目。
Edit:You can also check the HTML5 inputs and attributes for the browser you're actually using on this page.
编辑:您还可以检查您在此页面上实际使用的浏览器的 HTML5 输入和属性。