Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
cfinput coldfusion 11 validateat=";onBlur";-浏览器问题_Coldfusion_Coldfusion 11_Cfinput - Fatal编程技术网

cfinput coldfusion 11 validateat=";onBlur";-浏览器问题

cfinput coldfusion 11 validateat=";onBlur";-浏览器问题,coldfusion,coldfusion-11,cfinput,Coldfusion,Coldfusion 11,Cfinput,OnBlur语句在Internet Explorer中有效,但在Chrome中无效。我被难住了,不知道我做错了什么,或者是否有语法问题 <cfinput type="text" value="#Form[QtyNumber]#" class="prQuantity" validateat="onBlur" name="#QtyNumber#" validate="numeric" message="Please enter only whole numbers into the Quan

OnBlur语句在Internet Explorer中有效,但在Chrome中无效。我被难住了,不知道我做错了什么,或者是否有语法问题

 <cfinput type="text" value="#Form[QtyNumber]#" class="prQuantity" validateat="onBlur" name="#QtyNumber#" validate="numeric" message="Please enter only whole numbers into the Quantity Field.">    

如果您只想要数字,可能会考虑将其更改为

是的,我知道这不完全是您所问的,但这是您的示例msg所显示的,并且对我很有效。

与您的问题无关,但ValidateAt=“onBlur”永远都不够。用户可以清除警报,而不更改表单字段中的值,然后仍然提交表单。就您的问题而言,chrome上会发生什么?可能是您输入的名称显示为数字,因为您将名称设置为#QtyNumber#,而不是QtyNumber。从技术上讲,HTML名称可以是数字,但自动生成的输入的ID不应该(“不能”)是数字。不要使用
cfinput
(或任何CF UI功能),这只会让你头疼。尝试使用类似jQuery和jQuery验证的JavaScript库。更容易使用,更可定制,更强大。@ScottStroz,我完全同意。我猜您在使用CF11时正在开发一个更新的应用程序,所以最好停止使用ColdFusion UI功能。在我看来,客户端工作永远不应该依赖ColdFusion。使用Javascript/Jquery。