2

OnBlur statement works in Internet Explorer but not in Chrome. I am stumped and can not figure out what I am doing wrong or if there is a syntax issue.

 <cfinput type="text" value="#Form[QtyNumber]#" class="prQuantity" validateat="onBlur" name="#QtyNumber#" validate="numeric" message="Please enter only whole numbers into the Quantity Field.">    
James A Mohler
  • 11,060
  • 15
  • 46
  • 72
mrmcg
  • 173
  • 6
  • 17
  • 3
    Not related to your question but, ValidateAt="onBlur" is never sufficient. The user can clear the alert, not change the value in the form field, and still submit the form. As far as your question goes, what happens on chrome? – Dan Bracuk Oct 27 '14 at 14:59
  • 1
    It might be that your input's name comes out as a number because you have the name set to #QtyNumber# rather than QtyNumber. While HTML names can technically be numbers, the auto-generated input's ID should not ("can not") be a number. – Regular Jo Oct 27 '14 at 15:38
  • 1
    Don't use `cfinput` (or any of the CF UI functionality), it will only cause you headaches down the road. Try using a JavaScript library like jQuery and jQuery Validate. Much easier to use, much more customizable, and much more powerful. – Scott Stroz Oct 28 '14 at 00:12
  • @ScottStroz, I completely agree. I guess you are working on a newer application as you are using CF11, So better stop using ColdFusion UI functionalists. From my point of view you should never depend upon ColdFusion for client side work. Use Javascript/Jquery. – Deepak Kumar Padhy Oct 28 '14 at 01:29

1 Answers1

0

Might look into changing it to a <cfinput ... mask="99999"> if you JUST want numbers. http://help.adobe.com/en_US/ColdFusion/10.0/Developing/WSc3ff6d0ea77859461172e0811cbec0ffd8-7ffe.html Yes, I know that is not exactly what you asked, but it is what your example msg shows and has worked well for me.

Musselman
  • 163
  • 2
  • 11